import{j as t}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b.js";import{u as c}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b20.js";import{u as l}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b34.js";import{c as p,u as g}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b90.js";import{H as C,dc as u,Q as x,I as f}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b11.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b46.js";import{E as h}from"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b118.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b8.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b19.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b7.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b23.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b4.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b3.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b2.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b10.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b6.js";import"./v_7_4_3_17_17ffe662-3f12-45a2-ae5d-997b41d0d61b9.js";function P(){const{language:e}=c(),{model:o,category:r,setCategory:a}=p(),{addCategory:s,editCategory:m}=l(),{setActiveRenderCategoria:n}=g(),d=()=>{if(r.name.length<3){f({type:"Error",message:e.insertNameAtLeast3Chars,position:"top-right"});return}o==="create"?s(r):m(r),n("list")};return t.jsxs("div",{className:"p-2 overflow-hidden",children:[t.jsx("div",{className:"ml-9",children:t.jsx(C,{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:i=>a("name",i)}),t.jsx(u,{colorInicial:o==="edit"?r.hexColor:null,title:e.pickColor,onChange:i=>a("hexColor",i)})]}),t.jsx("div",{className:"flex justify-center my-2",children:t.jsx(x,{name:o==="edit"?e.saveEdit:e.save,funcao:d})})]})}export{P as default};
