PageSourceSearch

https://help.speechelo.com/build/assets/SuggestFeature--YzbhkQI.js

js speechelo.com collected 2026-09-25 20:14:34 UTC 30,729 bytes, 16 lines download raw bytes

1import{r as s,j as e}from"./vendor-react-DgB3iddG.js";import{C as oe,c as ie}from"./Card-BcZ3an93.js";import{B as P}from"./Button-BttGaDhY.js";import{I as H}from"./Input-BsRlGHyA.js";import{C as de}from"./ConfirmDialog-atZ8YJiE.js";import{e as V,a as I,u as ce}from"./index-BjBy4T9C.js";import{L as me}from"./Loader-BvcmIkPe.js";import{P as xe}from"./PageHeader-Dmd73UqM.js";import{u as ue}from"./usePageTitle-DrV3LWkF.js";import{B as E,L as M}from"./lightbulb-z2cMK5bn.js";import{T as pe}from"./trending-up-C0Nhf-4e.js";import{C as D}from"./check-CIYCIG8l.js";import{C as W}from"./clock-HA6-FVi9.js";import{T as Z,a as ee}from"./thumbs-up-c0ohMbrl.js";import{M as te}from"./message-circle-eUPhiD3L.js";import{S as be}from"./star-xBAYjUsq.js";import{T as re}from"./trash-2-BweadGWf.js";import{X as se}from"./x-D2X7xtQ2.js";import{E as he}from"./eye-off-D3i3o61t.js";import{E as fe}from"./eye-_v7bFcCI.js";import{S as ge}from"./send-CK12V0TD.js";import{P as Q}from"./plus-ZtJyo1EB.js";import{S as je}from"./search-Bc8E7q54.js";import"./vendor-radix-Cc5wg9nu.js";import"./useDismissableModal-BQmfYHyf.js";import"./circle-check-big-B7fMeiDk.js";import"./info-B8vWxzCV.js";import"./circle-x-CeSD-TKo.js";import"./vendor-realtime-BWTNjo9H.js";import"./vendor-mui-dates-KAGm-C0e.js";/**
2 * @license lucide-react v0.554.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const ye=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],ve=V("ellipsis-vertical",ye);/**
7 * @license lucide-react v0.554.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Ne=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],ae=V("heart",Ne);/**
12 * @license lucide-react v0.554.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const we=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],q=V("pin",we),X={feature:{icon:M,label:"Feature",color:"text-amber-500",bg:"bg-amber-500/10",border:"border-amber-500/30"},bug:{icon:E,label:"Bug",color:"text-red-500",bg:"bg-red-500/10",border:"border-red-500/30"}},J={integration:{label:"Integration",color:"text-blue-500",bg:"bg-blue-500/10"},inbox:{label:"Social Inbox",color:"text-purple-500",bg:"bg-purple-500/10"},messaging:{label:"Messaging",color:"text-green-500",bg:"bg-green-500/10"},account:{label:"Account",color:"text-orange-500",bg:"bg-orange-500/10"},analytics:{label:"Analytics",color:"text-cyan-500",bg:"bg-cyan-500/10"},other:{label:"Other",color:"text-gray-500",bg:"bg-gray-500/10"}},z={low:{label:"Low",color:"text-gray-500",bg:"bg-gray-500/10"},medium:{label:"Medium",color:"text-yellow-500",bg:"bg-yellow-500/10"},high:{label:"High",color:"text-orange-500",bg:"bg-orange-500/10"},critical:{label:"Critical",color:"text-red-500",bg:"bg-red-500/10"}},G={pending:{label:"Pending",color:"text-gray-500",bg:"bg-gray-500/10"},under_review:{label:"Under Review",color:"text-blue-500",bg:"bg-blue-500/10"},planned:{label:"Planned",color:"text-purple-500",bg:"bg-purple-500/10"},implemented:{label:"Implemented",color:"text-green-500",bg:"bg-green-500/10"},resolved:{label:"Resolved",color:"text-green-500",bg:"bg-green-500/10"}};function ke({suggestion:t,isAdmin:c,currentUserId:f,onVote:g,onDelete:p,onStatusChange:l,onPriorityChange:C,onTogglePin:F,onClick:m}){var y,w,x,O,a,_;const[v,n]=s.useState(!1),d=X[t.type]||X.feature,o=J[t.category]||J.other,N=t.user_vote_status||{up:!1,down:!1,heart:!1};(t.upvotes||0)-(t.downvotes||0);const $=f&&t.user_id===f||c,T=d.icon;return e.jsxs("div",{className:`group relative bg-card border rounded-xl transition-all duration-300 hover:shadow-lg hover:shadow-
16primary/5 hover:-translate-y-0.5 cursor-pointer ${t.is_pinned?"ring-2 ring-amber-500/50 border-amber-500/30":"border-border"}`,onClick:m,children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/5 via-purple-500/5 to-pink-500/5 opacity-0 group-hover:opacity-100 transition-opacity"}),e.jsxs("div",{className:"relative p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.is_pinned&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-amber-500/10 text-amber-500 border border-amber-500/30",children:[e.jsx(q,{className:"w-3 h-3"}),"Pinned"]}),e.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${d.bg} ${d.color} ${d.border} border`,children:[e.jsx(T,{className:"w-3 h-3"}),d.label]}),e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${o.bg} ${o.color}`,children:o.label}),t.priority&&e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ${(y=z[t.priority])==null?void 0:y.bg} ${(w=z[t.priority])==null?void 0:w.color}`,children:(x=z[t.priority])==null?void 0:x.label}),t.is_trending&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-gradient-to-r from-orange-500/10 to-red-500/10 text-orange-500 border border-orange-500/30",children:[e.jsx(pe,{className:"w-3 h-3"}),"Trending"]})]}),t.status!=="pending"&&e.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${(O=G[t.status])==null?void 0:O.bg} ${(a=G[t.status])==null?void 0:a.color}`,children:[t.status==="implemented"||t.status==="resolved"?e.jsx(D,{className:"w-3 h-3"}):e.jsx(W,{className:"w-3 h-3"}),(_=G[t.status])==null?void 0:_.label]})]}),e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2 line-clamp-2 group-hover:text-primary transition-colors",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-4",children:t.description}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-1",onClick:k=>k.stopPropagation(),children:[e.jsxs("button",{onClick:()=>g(t.id,"up"),className:`flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-sm font-medium transition-all ${N.up?"bg-green-500/20 text-green-500 border border-green-500/30":"bg-secondary text-muted-foreground hover:text-green-500 hover:bg-green-500/10"}`,children:[e.jsx(Z,{className:"w-4 h-4"}),e.jsx("span",{children:t.upvotes||0})]}),e.jsxs("button",{onClick:()=>g(t.id,"down"),className:`flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-sm font-medium transition-all ${N.down?"bg-red-500/20 text-red-500 border border-red-500/30":"bg-secondary text-muted-foreground hover:text-red-500 hover:bg-red-500/10"}`,children:[e.jsx(ee,{className:"w-4 h-4"}),e.jsx("span",{children:t.downvotes||0})]}),e.jsxs("button",{onClick:()=>g(t.id,"heart"),className:`flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-sm font-medium transition-all ${N.heart?"bg-pink-500/20 text-pink-500 border border-pink-500/30":"bg-secondary text-muted-foreground hover:text-pink-500 hover:bg-pink-500/10"}`,children:[e.jsx(ae,{className:`w-4 h-4 ${N.heart?"fill-current":""}`}),e.jsx("span",{children:t.hearts||0})]})]}),e.jsxs("div",{className:"flex items-center gap-2",onClick:k=>k.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground text-sm",children:[e.jsx(te,{className:"w-4 h-4"}),e.jsx("span",{children:t.comments_count||0})]}),(c||$)&&e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:k=>{k.stopPropagation(),n(!v)},className:"p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-secondary transition-colors",children:e.jsx(ve,{className:"w-4 h-4"})}),v&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>n(!1)}),e.jsxs("div",{className:"absolute right-0 bottom-full mb-2 z-50 w-48 bg-card border border-border rounded-lg shadow-xl py-1",children:[c&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>{F(t.id),n(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-secondary flex items-center gap-2",children:[e.jsx(q,{className:"w-4 h-4"}),t.is_pinned?"Unpin":"Pin to Top"]}),t.type==="feature"&&e.jsxs("button",{onClick:()=>{l(t.id,t.status==="implemented"?"pending":"implemented"),n(!1)},className:`w-full text-left px-3 py-2 text-sm hover:bg-secondary flex items-center gap-2 ${t.status==="implemented"?"text-orange-500":"text-green-500"}`,children:[e.jsx(D,{className:"w-4 h-4"}),t.status==="implemented"?"Unmark Implemented":"Mark Implemented"]}),t.type==="bug"&&e.jsxs("button",{onClick:()=>{l(t.id,t.status==="resolved"?"pending":"resolved"),n(!1)},className:`w-full text-left px-3 py-2 text-sm hover:bg-secondary flex items-center gap-2 ${t.status==="resolved"?"text-orange-500":"text-green-500"}`,children:[e.jsx(D,{className:"w-4 h-4"}),t.status==="resolved"?"Unmark Resolved":"Mark Resolved"]}),e.jsxs("button",{onClick:()=>{l(t.id,t.status==="under_review"?"pending":"under_review"),n(!1)},className:`w-full text-left px-3 py-2 text-sm hover:bg-secondary flex items-center gap-2 ${t.status==="under_review"?"text-orange-500":"text-blue-500"}`,children:[e.jsx(W,{className:"w-4 h-4"}),t.status==="under_review"?"Unmark Under Review":"Mark Under Review"]}),e.jsxs("button",{onClick:()=>{l(t.id,t.status==="planned"?"pending":"planned"),n(!1)},className:`w-full text-left px-3 py-2 text-sm hover:bg-secondary flex items-center gap-2 ${t.status==="planned"?"text-orange-500":"text-purple-500"}`,children:[e.jsx(be,{className:"w-4 h-4"}),t.status==="planned"?"Unmark Planned":"Mark as Planned"]}),e.jsx("div",{className:"border-t border-border my-1"})]}),$&&e.jsxs("button",{onClick:()=>
16{p(t.id),n(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-destructive/10 flex items-center gap-2 text-destructive",children:[e.jsx(re,{className:"w-4 h-4"}),"Delete"]})]})]})]})]})]}),e.jsxs("div",{className:"mt-3 pt-3 border-t border-border/50 flex items-center justify-between text-xs text-muted-foreground",children:[e.jsxs("span",{children:["by ",e.jsx("span",{className:"font-medium text-foreground",children:t.display_author||"Anonymous"})]}),e.jsx("span",{children:new Date(t.created_at).toLocaleDateString()})]})]})]})}const Se=[{id:"integration",label:"New Integration"},{id:"inbox",label:"Inbox Feature"},{id:"messaging",label:"Messaging"},{id:"account",label:"Account"},{id:"analytics",label:"Analytics"},{id:"other",label:"Other"}];function Ce({isOpen:t,onClose:c,onSubmit:f,userName:g}){const[p,l]=s.useState("feature"),[C,F]=s.useState(""),[m,v]=s.useState(""),[n,d]=s.useState("other"),[o,N]=s.useState(!1),[j,$]=s.useState(g||""),[T,y]=s.useState(!1),[w,x]=s.useState(null),O=async a=>{if(a.preventDefault(),!C.trim()||!m.trim()){x("Please fill in all required fields.");return}y(!0),x(null);try{await f({type:p,title:C.trim(),description:m.trim(),category:n,is_anonymous:o,author_name:o?j.trim()||"Anonymous":j.trim()}),l("feature"),F(""),v(""),d("other"),N(!1)}catch(_){x(_.message||"Failed to submit. Please try again.")}finally{y(!1)}};return t?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:c}),e.jsxs("div",{className:"relative w-full max-w-lg bg-card border border-border rounded-2xl shadow-2xl overflow-hidden animate-in fade-in zoom-in-95 duration-200",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-r from-primary/10 via-purple-500/10 to-pink-500/10 p-6 pb-4",children:[e.jsx("button",{onClick:c,className:"absolute top-4 right-4 p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-white/10 transition-colors",children:e.jsx(se,{className:"w-5 h-5"})}),e.jsx("h2",{className:"text-xl font-bold text-foreground",children:"Share Your Idea"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Help us improve PageDock with your feedback"})]}),e.jsxs("form",{onSubmit:O,className:"p-6 space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-2",children:"What would you like to submit?"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>l("feature"),className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-xl font-medium transition-all ${p==="feature"?"bg-amber-500/20 text-amber-500 border-2 border-amber-500/50 shadow-lg shadow-amber-500/10":"bg-secondary text-muted-foreground hover:text-foreground border-2 border-transparent"}`,children:[e.jsx(M,{className:"w-5 h-5"}),"Feature Request"]}),e.jsxs("button",{type:"button",onClick:()=>l("bug"),className:`flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-xl font-medium transition-all ${p==="bug"?"bg-red-500/20 text-red-500 border-2 border-red-500/50 shadow-lg shadow-red-500/10":"bg-secondary text-muted-foreground hover:text-foreground border-2 border-transparent"}`,children:[e.jsx(E,{className:"w-5 h-5"}),"Bug Report"]})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium mb-2",children:["Title ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx(H,{value:C,onChange:a=>F(a.target.value),placeholder:p==="feature"?"E.g., Add dark mode scheduling":"E.g., Comments not loading on mobile",maxLength:255})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium mb-2",children:["Description ",e.jsx("span",{className:"text-destructive",children:"*"})]}),e.jsx("textarea",{value:m,onChange:a=>v(a.target.value),placeholder:p==="feature"?"Describe your idea in detail. What problem does it solve? How would it work?":"Describe the issue. What did you expect? What happened instead?",rows:4,maxLength:5e3,className:"w-full px-3 py-2 rounded-lg border border-input bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary resize-none"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 text-right",children:[m.length,"/5000"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-2",children:"Category"}),e.jsx("select",{value:n,onChange:a=>d(a.target.value),className:"w-full h-10 px-3 rounded-lg border border-input bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary",children:Se.map(a=>e.jsx("option",{value:a.id,children:a.label},a.id))})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 bg-secondary/50 rounded-xl",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[o?e.jsx(he,{className:"w-5 h-5 text-muted-foreground"}):e.jsx(fe,{className:"w-5 h-5 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Post anonymously"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your name won't be shown publicly"})]})]}),e.jsx("button",{type:"button",onClick:()=>N(!o),className:`relative w-11 h-6 rounded-full transition-colors ${o?"bg-primary":"bg-muted"}`,children:e.jsx("div",{className:`absolute top-1 w-4 h-4 rounded-full bg-white shadow-sm transition-transform ${o?"translate-x-6":"translate-x-1"}`})})]}),o&&e.jsxs("div",{className:"animate-in fade-in slide-in-from-top-2",children:[e.jsx("label",{className:"block text-sm font-medium mb-2",children:"Display Name (optional)"}),e.jsx(H,{value:j,onChange:a=>$(a.target.value),placeholder:"Anonymous",maxLength:100}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:'This name will be shown instead of "Anonymous"'})]}),w&&e.jsx("div",{className:"p-3 bg-destructive/10 text-destructive text-sm rounded-lg",children:w}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx(P,{type:"button",variant:"outline",onClick:c,className:"flex-1",children:"Cancel"}),e.jsx(P,{type:"submit",disabled:T,className:"flex-1 bg-gradient-to-r from-primary to-purple-600 hover:from-primary/90 hover:to-purple-600/90",children:T?"Submitting...":"Submit"})]})]})]})]}):null}const K={feature:{icon:M,label:"Feature Request",color:"text-amber-500",bg:"bg-amber-500/10"},bug:{icon:E,label:"Bug Report",color:"text-red-500",bg:"bg-red-500/10"}},Y={pending:{label:"Pending",color:"text-gray-500",bg:"bg-gray-500/10"},under_review:{label:"Under Review",color:"text-blue-500",bg:"bg-blue-500/10"},planned:{label:"Planned",color:"text-purple-500",bg:"bg-purple-500/10"},implemented:{label:"Implemented",color:"text-green-500",bg:"bg-green-500/10"},resolved:{label:"Resolved",color:"text-green-500",bg:"bg-green-500/10"}};function _e({suggestion:t,isOpen:c,onClose:f,isAdmin:g,currentUserId:p,onVote:l,onDelete:C,onStatusChange:F,onRefresh:m}){var A,R,L;const[v,n]=s.useState((t==null?void 0:t.comments)||[]),[d,o]=s.useState(""),[N,j]=s.useState(!1),[$,T]=s.useState(!1);s.useEffect(()=>{c&&(t!=null&&t.id)&&y()},[c,t==null?void 0:t.id]);const y=async()=>{var b;try{T(!0);const h=await I.getFeatureSuggestion(t.id);n(((b=h.suggestion)==null?void 0:b.comments)||[])}catch(h){console.error("Failed to load comments",h)}finally{T(!1)}},w=async b=>{if(b.preventDefault(),!!d.trim()){j(!0);try{const h=await I.commentFeatureSuggestion(t.id,d.trim());n(B=>[...B,h.comment]),o(""),m==null||m()}catch(h){console.error("Failed to add comment",h)}finally{j(!1)}}};if(!c||!t)return null;const x=K[t.type]||K.feature,O=x.icon,a=t.user_vote_status||{up:!1,down:!1,heart:!1},k=p&&t.user_id===p||g;return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:f}),e.jsxs("div",{className:"relative w-full max-w-2xl max-h-[90vh] bg-card border border-border rounded-2xl shadow-2xl overflow-hidden animate-in fade-in zoom-in-95 duration-200 flex flex-col",children:[e.jsxs("div",{className:"relative bg-gradient-to-r from-primary/5 via-purple-500/5 to-pink-500/5 p-6 border-b border-border",children:[e.jsx("button",{onClick:f,className:"absolute top-4 right-4 p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-white/10 transition-colors",children:e.jsx(se,{className:"w-5 h-5"})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-3",children:[t.is_pinned&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-amber-500/10 text-amber-500 border border-amber-500/30",children:[e.jsx(q,{className:"w-3 h-3"}),"Pinned"]}),e.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${x.bg} ${x.color}`,children:[e.jsx(O,{className:"w-3 h-3"}),x.label]}),e.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${(A=Y[t.status])==null?void 0:A.bg} ${(R=Y[t.status])==null?void 0:R.color}`,children:[t.status==="implemented"||t.status==="resolved"?e.jsx(D,{className:"w-3 h-3"}):e.jsx(W,{className:"w-3 h-3"}),(L=Y[t.status])==null?void 0:L.label]})]}),e.jsx("h2",{className:"text-xl font-bold text-foreground pr-8",children:t.title}),e.jsxs("div",{className:"flex items-center gap-4 mt-3 text-sm text-muted-foreground",children:[e.jsxs("span",{children:["by ",e.jsx("span",{className:"font-medium text-foreground",children:t.display_author||"Anonymous"})]}),e.jsx("span",{children:"•"}),e.jsx("span",{children:new Date(t.created_at).toLocaleDateString()})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Description"}),e.jsx("p",{className:"text-foreground whitespace-pre-wrap",children:t.description})]}),t.resolution_description&&e.jsxs("div",{className:"p-4 bg-green-500/10 border border-green-500/20 rounded-xl",children:[e.jsxs("h3",{className:"text-sm font-medium text-green-500 mb-2 flex items-center gap-2",children:[e.jsx(D,{className:"w-4 h-4"}),t.status==="implemented"?"Implementation Details":"Resolution Details"]}
16),e.jsx("p",{className:"text-foreground text-sm",children:t.resolution_description}),t.implemented_at&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Implemented on ",new Date(t.implemented_at).toLocaleDateString()]}),t.resolved_at&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Resolved on ",new Date(t.resolved_at).toLocaleDateString()]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>l(t.id,"up"),className:`flex items-center gap-2 px-4 py-2 rounded-xl font-medium transition-all ${a.up?"bg-green-500/20 text-green-500 border border-green-500/30":"bg-secondary text-muted-foreground hover:text-green-500 hover:bg-green-500/10"}`,children:[e.jsx(Z,{className:"w-5 h-5"}),e.jsx("span",{children:t.upvotes||0})]}),e.jsxs("button",{onClick:()=>l(t.id,"down"),className:`flex items-center gap-2 px-4 py-2 rounded-xl font-medium transition-all ${a.down?"bg-red-500/20 text-red-500 border border-red-500/30":"bg-secondary text-muted-foreground hover:text-red-500 hover:bg-red-500/10"}`,children:[e.jsx(ee,{className:"w-5 h-5"}),e.jsx("span",{children:t.downvotes||0})]}),e.jsxs("button",{onClick:()=>l(t.id,"heart"),className:`flex items-center gap-2 px-4 py-2 rounded-xl font-medium transition-all ${a.heart?"bg-pink-500/20 text-pink-500 border border-pink-500/30":"bg-secondary text-muted-foreground hover:text-pink-500 hover:bg-pink-500/10"}`,children:[e.jsx(ae,{className:`w-5 h-5 ${a.heart?"fill-current":""}`}),e.jsx("span",{children:t.hearts||0})]})]}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium text-muted-foreground mb-4 flex items-center gap-2",children:[e.jsx(te,{className:"w-4 h-4"}),"Comments (",v.length,")"]}),e.jsx("div",{className:"space-y-3 mb-4",children:v.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No comments yet. Be the first to share your thoughts!"}):v.map(b=>{var h;return e.jsxs("div",{className:"p-3 bg-secondary/50 rounded-xl",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:((h=b.user)==null?void 0:h.name)||"Unknown User"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(b.created_at).toLocaleDateString()})]}),e.jsx("p",{className:"text-sm text-foreground",children:b.content})]},b.id)})}),e.jsxs("form",{onSubmit:w,className:"flex gap-2",children:[e.jsx("input",{type:"text",value:d,onChange:b=>o(b.target.value),placeholder:"Add a comment...",className:"flex-1 px-4 py-2 rounded-xl border border-input bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary",maxLength:2e3}),e.jsx(P,{type:"submit",disabled:N||!d.trim(),size:"icon",className:"rounded-xl",children:e.jsx(ge,{className:"w-4 h-4"})})]})]})]}),(g||k)&&e.jsxs("div",{className:"p-4 border-t border-border bg-secondary/30 flex items-center justify-between",children:[e.jsx("div",{className:"flex items-center gap-2",children:g&&t.status!=="implemented"&&t.status!=="resolved"&&e.jsxs(e.Fragment,{children:[t.type==="feature"&&e.jsxs(P,{variant:"outline",size:"sm",onClick:()=>{F(t.id,"implemented"),f()},className:"text-green-500 border-green-500/30 hover:bg-green-500/10",children:[e.jsx(D,{className:"w-4 h-4 mr-2"}),"Mark Implemented"]}),t.type==="bug"&&e.jsxs(P,{variant:"outline",size:"sm",onClick:()=>{F(t.id,"resolved"),f()},className:"text-green-500 border-green-500/30 hover:bg-green-500/10",children:[e.jsx(D,{className:"w-4 h-4 mr-2"}),"Mark Resolved"]})]})}),k&&e.jsxs(P,{variant:"outline",size:"sm",onClick:()=>{C(t.id),f()},className:"text-destructive border-destructive/30 hover:bg-destructive/10",children:[e.jsx(re,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})]})}const Fe=[{id:"suggestions",label:"Suggested Features",icon:M},{id:"implemented",label:"Implemented",icon:D},{id:"resolved",label:"Resolved Problems",icon:E}],Te=[{id:"votes",label:"Most Voted"},{id:"newest",label:"Newest"},{id:"hearts",label:"Most Loved"},{id:"trending",label:"Trending"}],Ie=[{id:"all",label:"All Categories"},{id:"integration",label:"New Integration"},{id:"inbox",label:"Social Inbox Feature"},{id:"messaging",label:"Messaging"},{id:"account",label:"Account"},{id:"analytics",label:"Analytics"},{id:"other",label:"Other"}];function ot(){ue("Suggest Feature");const{user:t}=ce(),c=(t==null?void 0:t.is_admin)||!1,[f,g]=s.useState(!0),[p,l]=s.useState([]),[C,F]=s.useState("suggestions"),[m,v]=s.useState(""),[n,d]=s.useState("votes"),[o,N]=s.useState("all"),[j,$]=s.useState("all"),[T,y]=s.useState(!1),[w,x]=s.useState(null),[O,a]=s.useState(!1),[_,k]=s.useState({isOpen:!1,suggestionId:null});s.useEffect(()=>{A()},[C,n,o,j,m]);const A=async()=>{try{g(!0);const r={tab:C,sort:n,category:o,search:m};j!=="all"&&(r.type=j);const i=await I.getFeatureSuggestions(r);l(i.suggestions||[])}catch(r){console.error("Failed to load suggestions",r)}finally{g(!1)}},R=async(r,i)=>{try{const u=await I.voteFeatureSuggestion(r,i);l(S=>S.map(U=>U.id===r?{...U,upvotes:u.upvotes,downvotes:u.downvotes,hearts:u.hearts,user_vote_status:u.user_vote_status}:U))}catch(u){console.error("Failed to vote",u)}},L=r=>{k({isOpen:!0,suggestionId:r})},b=async()=>
16{if(_.suggestionId)try{await I.deleteFeatureSuggestion(_.suggestionId),l(r=>r.filter(i=>i.id!==_.suggestionId))}catch(r){console.error("Failed to delete",r)}},h=async(r,i,u=null)=>{try{await I.updateFeatureSuggestionStatus(r,i,u),A()}catch(S){console.error("Failed to update status",S)}},B=async(r,i)=>{try{await I.setFeatureSuggestionPriority(r,i),l(u=>u.map(S=>S.id===r?{...S,priority:i}:S))}catch(u){console.error("Failed to set priority",u)}},le=async r=>{try{const i=await I.toggleFeatureSuggestionPin(r);l(u=>u.map(S=>S.id===r?{...S,is_pinned:i.suggestion.is_pinned}:S))}catch(i){console.error("Failed to toggle pin",i)}},ne=async r=>{try{await I.createFeatureSuggestion(r),y(!1),A()}catch(i){throw console.error("Failed to create suggestion",i),i}};return e.jsxs("div",{className:"space-y-6",children:[e.jsx(xe,{title:"Feature Hub",description:"Share your ideas, report bugs, and help shape the future of PageDock",icon:M,iconColor:"text-amber-500",iconBgColor:"bg-amber-500/10",iconBorderColor:"border-amber-500/20"}),e.jsxs("div",{className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-primary/10 via-purple-500/10 to-pink-500/10 border border-primary/20 p-8",children:[e.jsx("div",{className:"absolute inset-0 bg-grid-white/10 [mask-image:linear-gradient(0deg,transparent,black)]"}),e.jsxs("div",{className:"relative flex flex-col md:flex-row items-center justify-between gap-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground mb-2",children:"Have an idea?"}),e.jsx("p",{className:"text-muted-foreground max-w-md",children:"Your feedback helps us build a better product. Suggest features, report bugs, and vote on what matters most to you."})]}),e.jsxs(P,{onClick:()=>y(!0),className:"bg-gradient-to-r from-primary to-purple-600 hover:from-primary/90 hover:to-purple-600/90 text-white shadow-lg shadow-primary/25 gap-2",size:"lg",children:[e.jsx(Q,{className:"w-5 h-5"}),"New Suggestion"]})]})]}),e.jsx("div",{className:"flex flex-wrap items-center gap-2 border-b border-border pb-4",children:Fe.map(r=>e.jsxs("button",{onClick:()=>F(r.id),className:`flex items-center gap-2 px-4 py-2 rounded-lg font-medium transition-all ${C===r.id?"bg-primary text-primary-foreground shadow-md shadow-primary/25":"text-muted-foreground hover:text-foreground hover:bg-secondary"}`,children:[e.jsx(r.icon,{className:"w-4 h-4"}),r.label]},r.id))}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(je,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground"}),e.jsx(H,{placeholder:"Search suggestions...",value:m,onChange:r=>v(r.target.value),className:"pl-10"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("select",{value:j,onChange:r=>$(r.target.value),className:"h-10 px-3 rounded-lg border border-input bg-background text-sm focus:ring-2 focus:ring-primary",children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"feature",children:"Features"}),e.jsx("option",{value:"bug",children:"Bugs"})]}),e.jsx("select",{value:o,onChange:r=>N(r.target.value),className:"h-10 px-3 rounded-lg border border-input bg-background text-sm focus:ring-2 focus:ring-primary",children:Ie.map(r=>e.jsx("option",{value:r.id,children:r.label},r.id))}),e.jsx("select",{value:n,onChange:r=>d(r.target.value),className:"h-10 px-3 rounded-lg border border-input bg-background text-sm focus:ring-2 focus:ring-primary",children:Te.map(r=>e.jsx("option",{value:r.id,children:r.label},r.id))})]})]}),f?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(me,{})}):p.length===0?e.jsx(oe,{className:"text-center py-12",children:e.jsxs(ie,{children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:e.jsx(M,{className:"w-8 h-8 text-muted-foreground"})}),e.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No suggestions yet"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"Be the first to share your idea!"}),e.jsxs(P,{onClick:()=>y(!0),className:"gap-2",children:[e.jsx(Q,{className:"w-4 h-4"}),"Create Suggestion"]})]})}):e.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:p.map(r=>e.jsx(ke,{suggestion:r,isAdmin:c,currentUserId:t==null?void 0:t.id,onVote:R,onDelete:L,onStatusChange:h,onPriorityChange:B,onTogglePin:le,onClick:()=>x(r)},r.id))}),e.jsx(Ce,{isOpen:T,onClose:()=>y(!1),onSubmit:ne,userName:t==null?void 0:t.name}),w&&e.jsx(_e,{suggestion:w,isOpen:!!w,onClose:()=>x(null),isAdmin:c,currentUserId:t==null?void 0:t.id,onVote:R,onDelete:L,onStatusChange:h,onRefresh:A}),e.jsx(de,{isOpen:_.isOpen,onClose:()=>k({isOpen:!1,suggestionId:null}),onConfirm:b,title:"Delete Suggestion",message:"Are you sure you want to delete this suggestion? This action cannot be undone.",confirmText:"Delete",type:"danger"})]})}
16export{ot as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.