import{j as t,H as l,bu as p,Q as c,I as g}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080910.js";import{u as C}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080919.js";import{u}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080935.js";import{c as x,a as f}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080998.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080947.js";import{E as h}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b2250809120.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080918.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508098.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508094.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b2250809.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508095.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508097.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080923.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508096.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508092.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508093.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508099.js";function P(){const{language:e}=C(),{model:o,category:r,setCategory:i}=x(),{addCategory:s,editCategory:n}=u(),{setActiveRenderCategoria:m}=f(),d=()=>{if(r.name.length<3){g({type:"Error",message:e.insertNameAtLeast3Chars,position:"top-right"});return}o==="create"?s(r):n(r),m("list")};return t.jsxs("div",{className:"p-2 overflow-hidden",children:[t.jsx("div",{className:"ml-9",children:t.jsx(l,{weight:"600",children:o==="edit"?e.editCategory:e.createCategory})}),t.jsxs("div",{className:"grid gap-4 pt-6",children:[t.jsx(h,{id:"Category_TextArea",titulo:e.insertName,type:"input",position:"bottom-end",placeholder:e.insertCategoryName,text:r.name,setText:a=>i("name",a)}),t.jsx(p,{colorInicial:o==="edit"?r.hexColor:null,title:e.pickColor,onChange:a=>i("hexColor",a)})]}),t.jsx("div",{className:"flex justify-center my-2",children:t.jsx(c,{name:o==="edit"?e.saveEdit:e.save,funcao:d})})]})}export{P as default};
