"use strict";
/*
 * ATTENTION: An "eval-source-map" devtool has been used.
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
self["webpackHotUpdate_N_E"]("app/bottles/[id]/page",{

/***/ "(app-pages-browser)/./src/components/TastingNoteForm.tsx":
/*!********************************************!*\
  !*** ./src/components/TastingNoteForm.tsx ***!
  \********************************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {

eval(__webpack_require__.ts("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"default\": function() { return /* binding */ TastingNoteForm; }\n/* harmony export */ });\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/jsx-dev-runtime.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"(app-pages-browser)/./node_modules/next/dist/compiled/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _services_save_tasting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/services/save-tasting */ \"(app-pages-browser)/./src/services/save-tasting.ts\");\n/* harmony import */ var _barrel_optimize_names_Loader2_Send_lucide_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! __barrel_optimize__?names=Loader2,Send!=!lucide-react */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/loader-2.js\");\n/* harmony import */ var _barrel_optimize_names_Loader2_Send_lucide_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! __barrel_optimize__?names=Loader2,Send!=!lucide-react */ \"(app-pages-browser)/./node_modules/lucide-react/dist/esm/icons/send.js\");\n/* __next_internal_client_entry_do_not_use__ default auto */ \nvar _s = $RefreshSig$();\n\n\n\nfunction TastingNoteForm(param) {\n    let { bottleId } = param;\n    _s();\n    const [rating, setRating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(85);\n    const [nose, setNose] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(\"\");\n    const [palate, setPalate] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(\"\");\n    const [finish, setFinish] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(\"\");\n    const [isSample, setIsSample] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);\n    const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);\n    const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);\n    const handleSubmit = async (e)=>{\n        e.preventDefault();\n        setLoading(true);\n        setError(null);\n        try {\n            const result = await (0,_services_save_tasting__WEBPACK_IMPORTED_MODULE_2__.saveTasting)({\n                bottle_id: bottleId,\n                rating,\n                nose_notes: nose,\n                palate_notes: palate,\n                finish_notes: finish,\n                is_sample: isSample\n            });\n            if (result.success) {\n                setNose(\"\");\n                setPalate(\"\");\n                setFinish(\"\");\n            // We don't need to manually refresh because of revalidatePath in the server action\n            } else {\n                setError(result.error || \"Fehler beim Speichern\");\n            }\n        } catch (err) {\n            setError(\"Ein unerwarteter Fehler ist aufgetreten\");\n        } finally{\n            setLoading(false);\n        }\n    };\n    return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"form\", {\n        onSubmit: handleSubmit,\n        className: \"space-y-6\",\n        children: [\n            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                className: \"space-y-3\",\n                children: [\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"label\", {\n                        className: \"block text-sm font-bold text-zinc-700 dark:text-zinc-300 flex justify-between\",\n                        children: [\n                            \"Rating \",\n                            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n                                children: [\n                                    rating,\n                                    \"/100\"\n                                ]\n                            }, void 0, true, {\n                                fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                                lineNumber: 54,\n                                columnNumber: 28\n                            }, this)\n                        ]\n                    }, void 0, true, {\n                        fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                        lineNumber: 53,\n                        columnNumber: 17\n                    }, this),\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"input\", {\n                        type: \"range\",\n                        min: \"0\",\n                        max: \"100\",\n                        value: rating,\n                        onChange: (e)=>setRating(parseInt(e.target.value)),\n                        className: \"w-full h-2 bg-zinc-200 dark:bg-zinc-800 rounded-lg appearance-none cursor-pointer accent-amber-600\"\n                    }, void 0, false, {\n                        fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                        lineNumber: 56,\n                        columnNumber: 17\n                    }, this),\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                        className: \"flex justify-between text-[10px] text-zinc-400 font-bold uppercase tracking-widest\",\n                        children: [\n                            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n                                children: \"Swill\"\n                            }, void 0, false, {\n                                fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                                lineNumber: 65,\n                                columnNumber: 21\n                            }, this),\n                            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n                                children: \"Dram\"\n                            }, void 0, false, {\n                                fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                                lineNumber: 66,\n                                columnNumber: 21\n                            }, this),\n                            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n                                children: \"Legendary\"\n                            }, void 0, false, {\n                                fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                                lineNumber: 67,\n                                columnNumber: 21\n                            }, this)\n                        ]\n                    }, void 0, true, {\n                        fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                        lineNumber: 64,\n                        columnNumber: 17\n                    }, this)\n                ]\n            }, void 0, true, {\n                fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                lineNumber: 52,\n                columnNumber: 13\n            }, this),\n            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                className: \"space-y-2\",\n                children: [\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"label\", {\n                        className: \"text-xs font-bold text-zinc-400 uppercase tracking-tighter\",\n                        children: \"Nose\"\n                    }, void 0, false, {\n                        fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                        lineNumber: 72,\n                        columnNumber: 17\n                    }, this),\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"textarea\", {\n                        value: nose,\n                        onChange: (e)=>setNose(e.target.value),\n                        placeholder: \"Aromen in der Nase...\",\n                        rows: 2,\n                        className: \"w-full p-3 bg-zinc-50 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-xl text-sm focus:ring-2 focus:ring-amber-500 outline-none resize-none transition-all dark:text-zinc-200\"\n                    }, void 0, false, {\n                        fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                        lineNumber: 73,\n                        columnNumber: 17\n                    }, this)\n                ]\n            }, void 0, true, {\n                fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                lineNumber: 71,\n                columnNumber: 13\n            }, this),\n            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                className: \"space-y-2\",\n                children: [\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"label\", {\n                        className: \"text-xs font-bold text-zinc-400 uppercase tracking-tighter\",\n                        children: \"Palate\"\n                    }, void 0, false, {\n                        fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                        lineNumber: 83,\n                        columnNumber: 17\n                    }, this),\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"textarea\", {\n                        value: palate,\n                        onChange: (e)=>setPalate(e.target.value),\n                        placeholder: \"Geschmack am Gaumen...\",\n                        rows: 2,\n                        className: \"w-full p-3 bg-zinc-50 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-xl text-sm focus:ring-2 focus:ring-amber-500 outline-none resize-none transition-all dark:text-zinc-200\"\n                    }, void 0, false, {\n                        fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                        lineNumber: 84,\n                        columnNumber: 17\n                    }, this)\n                ]\n            }, void 0, true, {\n                fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                lineNumber: 82,\n                columnNumber: 13\n            }, this),\n            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                className: \"space-y-2\",\n                children: [\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"label\", {\n                        className: \"text-xs font-bold text-zinc-400 uppercase tracking-tighter\",\n                        children: \"Finish\"\n                    }, void 0, false, {\n                        fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                        lineNumber: 94,\n                        columnNumber: 17\n                    }, this),\n                    /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"textarea\", {\n                        value: finish,\n                        onChange: (e)=>setFinish(e.target.value),\n                        placeholder: \"Nachhall...\",\n                        rows: 2,\n                        className: \"w-full p-3 bg-zinc-50 dark:bg-zinc-800 border border-zinc-200 dark:border-zinc-700 rounded-xl text-sm focus:ring-2 focus:ring-amber-500 outline-none resize-none transition-all dark:text-zinc-200\"\n                    }, void 0, false, {\n                        fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                        lineNumber: 95,\n                        columnNumber: 17\n                    }, this)\n                ]\n            }, void 0, true, {\n                fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                lineNumber: 93,\n                columnNumber: 13\n            }, this),\n            error && /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n                className: \"p-3 bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 text-xs rounded-lg border border-red-100 dark:border-red-900/50\",\n                children: error\n            }, void 0, false, {\n                fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                lineNumber: 105,\n                columnNumber: 17\n            }, this),\n            /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"button\", {\n                type: \"submit\",\n                disabled: loading,\n                className: \"w-full py-4 bg-zinc-900 dark:bg-zinc-100 text-zinc-100 dark:text-zinc-900 font-bold rounded-2xl flex items-center justify-center gap-2 hover:bg-amber-600 dark:hover:bg-amber-600 hover:text-white transition-all active:scale-[0.98] disabled:opacity-50 shadow-lg\",\n                children: loading ? /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Loader2_Send_lucide_react__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n                    className: \"animate-spin\",\n                    size: 20\n                }, void 0, false, {\n                    fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                    lineNumber: 115,\n                    columnNumber: 28\n                }, this) : /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {\n                    children: [\n                        /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(_barrel_optimize_names_Loader2_Send_lucide_react__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n                            size: 18\n                        }, void 0, false, {\n                            fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                            lineNumber: 117,\n                            columnNumber: 25\n                        }, this),\n                        \"Note Speichern\"\n                    ]\n                }, void 0, true)\n            }, void 0, false, {\n                fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n                lineNumber: 110,\n                columnNumber: 13\n            }, this)\n        ]\n    }, void 0, true, {\n        fileName: \"/home/robin/AI/Coding/Whisky/src/components/TastingNoteForm.tsx\",\n        lineNumber: 51,\n        columnNumber: 9\n    }, this);\n}\n_s(TastingNoteForm, \"xD5XKHeA9YAkflzOJ4KjtbYvZa4=\");\n_c = TastingNoteForm;\nvar _c;\n$RefreshReg$(_c, \"TastingNoteForm\");\n\n\n;\n    // Wrapped in an IIFE to avoid polluting the global scope\n    ;\n    (function () {\n        var _a, _b;\n        // Legacy CSS implementations will `eval` browser code in a Node.js context\n        // to extract CSS. For backwards compatibility, we need to check we're in a\n        // browser context before continuing.\n        if (typeof self !== 'undefined' &&\n            // AMP / No-JS mode does not inject these helpers:\n            '$RefreshHelpers$' in self) {\n            // @ts-ignore __webpack_module__ is global\n            var currentExports = module.exports;\n            // @ts-ignore __webpack_module__ is global\n            var prevSignature = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevSignature) !== null && _b !== void 0 ? _b : null;\n            // This cannot happen in MainTemplate because the exports mismatch between\n            // templating and execution.\n            self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n            // A module can be accepted automatically based on its exports, e.g. when\n            // it is a Refresh Boundary.\n            if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n                // Save the previous exports signature on update so we can compare the boundary\n                // signatures. We avoid saving exports themselves since it causes memory leaks (https://github.com/vercel/next.js/pull/53797)\n                module.hot.dispose(function (data) {\n                    data.prevSignature =\n                        self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports);\n                });\n                // Unconditionally accept an update to this module, we'll check if it's\n                // still a Refresh Boundary later.\n                // @ts-ignore importMeta is replaced in the loader\n                module.hot.accept();\n                // This field is set when the previous version of this module was a\n                // Refresh Boundary, letting us know we need to check for invalidation or\n                // enqueue an update.\n                if (prevSignature !== null) {\n                    // A boundary can become ineligible if its exports are incompatible\n                    // with the previous exports.\n                    //\n                    // For example, if you add/remove/change exports, we'll want to\n                    // re-execute the importing modules, and force those components to\n                    // re-render. Similarly, if you convert a class component to a\n                    // function, we want to invalidate the boundary.\n                    if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevSignature, self.$RefreshHelpers$.getRefreshBoundarySignature(currentExports))) {\n                        module.hot.invalidate();\n                    }\n                    else {\n                        self.$RefreshHelpers$.scheduleUpdate();\n                    }\n                }\n            }\n            else {\n                // Since we just executed the code for the module, it's possible that the\n                // new exports made it ineligible for being a boundary.\n                // We only care about the case when we were _previously_ a boundary,\n                // because we already accepted this update (accidental side effect).\n                var isNoLongerABoundary = prevSignature !== null;\n                if (isNoLongerABoundary) {\n                    module.hot.invalidate();\n                }\n            }\n        }\n    })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 10948 characters]\n//# sourceURL=webpack-internal:///(app-pages-browser)/./src/components/TastingNoteForm.tsx\n"));

/***/ })

});