import{j as t}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab.js";import{u as l}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab20.js";import{u as p}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab34.js";import{c,u as g}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab90.js";import{H as C,d8 as u,Q as x,I as f}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab11.js";import"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab46.js";import{E as h}from"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab118.js";import"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab8.js";import"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab19.js";import"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab7.js";import"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab23.js";import"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab4.js";import"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab3.js";import"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab2.js";import"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab10.js";import"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab6.js";import"./v_7_4_3_16_fa303664-d39f-4aec-85e8-7c81b2445eab9.js";function P(){const{language:e}=l(),{model:o,category:r,setCategory:a}=c(),{addCategory:s,editCategory:m}=p(),{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};
