import{r as e,t}from"./jsx-runtime-BbTa8W_M-1776590214964.js";import{t as n}from"./useTranslation-D1etqd9u-1776590214964.js";import{t as r}from"./circle-plus-cg9Cid_6-1776590214964.js";import{t as i}from"./trash-2-DaYZOh6f-1776590214964.js";import{t as a}from"./button-WiAFyHfP-1776590214964.js";import{a as o,n as s,o as c,r as l,t as u}from"./card-Cby8flFO-1776590214964.js";import{t as d}from"./input-BlYvaS0F-1776590214964.js";e();var f=t(),p=({data:e,setData:t})=>{let{t:p}=n(),m=()=>t(`specifications`,[...e.specifications,{name:``,value:``}]),h=n=>t(`specifications`,e.specifications.filter((e,t)=>t!==n)),g=(n,r,i)=>{let a=[...e.specifications];a[n][r]=i,t(`specifications`,a)};return(0,f.jsxs)(u,{className:`shadow-sm`,children:[(0,f.jsxs)(o,{className:`flex flex-row items-center justify-between`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(c,{children:p(`Product Specifications`)}),(0,f.jsx)(l,{children:p(`Add key features like Material, Weight, Dimensions.`)})]}),(0,f.jsxs)(a,{type:`button`,variant:`outline`,size:`sm`,onClick:m,children:[(0,f.jsx)(r,{className:`w-4 h-4 mr-2`}),` `,p(`Add Spec`)]})]}),(0,f.jsxs)(s,{className:`space-y-3`,children:[e.specifications.length===0&&(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground italic`,children:p(`No specifications added.`)}),e.specifications.map((e,t)=>(0,f.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,f.jsx)(d,{placeholder:p(`Name (e.g., Material)`),value:e.name,onChange:e=>g(t,`name`,e.target.value)}),(0,f.jsx)(d,{placeholder:p(`Value (e.g., 100% Cotton)`),value:e.value,onChange:e=>g(t,`value`,e.target.value)}),(0,f.jsx)(a,{type:`button`,variant:`ghost`,size:`icon`,onClick:()=>h(t),className:`text-destructive`,children:(0,f.jsx)(i,{className:`w-4 h-4`})})]},t))]})]})};export{p as t};