import{j as t,J as l,bC as p,V as c,I as g}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9910.js";import{u as C}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9919.js";import{u as x}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9935.js";import{c as u,a as f}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9997.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9947.js";import{E as h}from"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c99119.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9918.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c996.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c998.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c994.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c99.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c995.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c997.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c9923.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c999.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c992.js";import"./v_7_4_2_1_59f2e4f7-dc00-41f3-9942-b1c61b935c993.js";function P(){const{language:e}=C(),{model:o,category:r,setCategory:i}=u(),{addCategory:s,editCategory:n}=x(),{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};
