import{j as t,$ as d,cK as l,a2 as p,I as g}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab710.js";import{u as C}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab719.js";import{u}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab736.js";import{c as x,u as f}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab790.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab747.js";import{E as h}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7116.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab718.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab76.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab78.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab74.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab75.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab77.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab723.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab79.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab72.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab73.js";function P(){const{language:e}=C(),{model:o,category:r,setCategory:i}=x(),{addCategory:s,editCategory:n}=u(),{setActiveRenderCategoria:m}=f(),c=()=>{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(d,{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(l,{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(p,{name:o==="edit"?e.saveEdit:e.save,funcao:c})})]})}export{P as default};
