import{j as t}from"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f5.js";import{u as d}from"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f4.js";import{u as l}from"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f34.js";import{c as p,u as g}from"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f90.js";import{p as C,cS as u,r as x,I as f}from"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f7.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f46.js";import{E as h}from"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f118.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f3.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f2.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f23.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f9.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f10.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f20.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f8.js";import"./v_7_4_3_30_53befa88-12f2-496c-a84d-0f1f11019f4f6.js";function P(){const{language:e}=d(),{model:o,category:r,setCategory:i}=p(),{addCategory:s,editCategory:n}=l(),{setActiveRenderCategoria:m}=g(),c=()=>{if(r.name.length<3){f({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(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:a=>i("name",a)}),t.jsx(u,{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(x,{name:o==="edit"?e.saveEdit:e.save,funcao:c})})]})}export{P as default};
