import{r as e,t}from"./jsx-runtime-BbTa8W_M-1776590214964.js";import{i as n,r,t as i}from"./app-CXDQ5oEH-1776590214964.js";import{t as a}from"./useTranslation-D1etqd9u-1776590214964.js";import{t as o}from"./eye-eOgRHIou-1776590214964.js";import{t as s}from"./share-2-CtfdbBpM-1776590214964.js";import{t as c}from"./square-pen-C7i_eg4X-1776590214964.js";import{t as l}from"./star-wSlMsd-z-1776590214964.js";import{t as u}from"./store-CIvuFgNB-1776590214964.js";import{t as d}from"./button-WiAFyHfP-1776590214964.js";e();var f=t();function p({product:e,auth:t}){let{t:p}=a();return!t?.user||t.user.id!==e.seller_id?null:(0,f.jsxs)(`div`,{className:`w-full bg-primary/5 border border-primary/20 rounded-xl p-4 mb-6 flex flex-col sm:flex-row sm:items-center justify-between gap-4 animate-in fade-in slide-in-from-top-4 shadow-sm`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,f.jsx)(`div`,{className:`p-2 bg-primary/20 rounded-full text-primary`,children:(0,f.jsx)(u,{className:`w-5 h-5`})}),(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`p`,{className:`text-sm font-bold text-primary`,children:p(`You own this product`)}),(0,f.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`Manage visibility and settings directly from here.`)})]})]}),(0,f.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 bg-background border rounded-lg text-sm font-bold shadow-sm text-muted-foreground`,children:[(0,f.jsx)(o,{className:`w-4 h-4`}),(0,f.jsx)(`span`,{children:p(`:count Views`,{count:e.views_count||0})})]}),(0,f.jsx)(d,{variant:`outline`,size:`sm`,asChild:!0,className:`gap-2 bg-background shadow-sm hover:bg-muted`,children:(0,f.jsxs)(r,{href:route(`seller.products.edit`,e.id),children:[(0,f.jsx)(c,{className:`w-4 h-4`}),` `,p(`Edit`)]})}),(0,f.jsxs)(d,{variant:`outline`,size:`sm`,onClick:()=>{n.post(route(`seller.products.toggle-featured`,e.id),{},{preserveScroll:!0,onSuccess:e=>{i.success(p(e.props.flash?.success||`Featured status updated!`))},onError:()=>i.error(p(`Failed to update featured status.`))})},className:`gap-2 shadow-sm transition-colors ${e.is_featured?`bg-amber-500/10 text-amber-600 border-amber-500/30 hover:bg-amber-500/20 hover:text-amber-700`:`bg-background hover:bg-muted`}`,children:[(0,f.jsx)(l,{className:`w-4 h-4 ${e.is_featured?`fill-amber-500`:``}`}),e.is_featured?p(`Unfeature`):p(`Feature This`)]}),(0,f.jsxs)(d,{variant:`outline`,size:`sm`,onClick:()=>{navigator.clipboard.writeText(window.location.href),i.success(p(`Product link copied to clipboard!`))},className:`gap-2 bg-background shadow-sm hover:bg-muted`,children:[(0,f.jsx)(s,{className:`w-4 h-4`}),` `,p(`Share`)]})]})]})}export{p as default};