1import{d as N,r as n,j as e,I as y,B as f,e as v,C as w,L as S,s as p,f as o}from"./index-BqYbkvvA.js";import{T as A}from"./textarea-AWvE-mmJ.js";import{A as C}from"./arrow-right-BDtJCT-c.js";/** 2 * @license lucide-react v0.462.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 P=N("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]),M=[{title:"Pasifika Festival 2026",location:"Auckland, NZ",date:"March 15-16"},{title:"Samoan Tatau Convention",location:"Apia, Samoa",date:"April 22-24"},{title:"Hawaiian Tattoo Arts Expo",location:"Honolulu, HI",date:"May 10-11"}],H=()=>{const[l,g]=n.useState([]),[i,d]=n.useState(""),[c,m]=n.useState(""),[x,h]=n.useState(!1),u=async()=>{const{data:s}=await p.from("community_posts").select("*").order("created_at",{ascending:!1}).limit(20);s&&g(s)};n.useEffect(()=>{u()},[]);const j=async s=>{s.preventDefault();const t=i.trim(),a=c.trim();if(!t||!a){o.error("Please fill in your name and message.");return}if(t.length>100||a.length>500){o.error("Name must be under 100 and message under 500 characters.");return}h(!0);const{error:r}=await p.from("community_posts").insert({author_name:t,content:a});h(!1),r?o.error("Failed to post. Please try again."):(o.success("Posted to the Ohana Wall!"),d(""),m(""),u())},b=s=>{const t=Date.now()-new Date(s).getTime(),a=Math.floor(t/6e4);if(a<60)return`${a}m ago`;const r=Math.floor(a/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`};return e.jsx("div",{className:"py-12",children:e.jsxs("div",{className:"container",children:[e.jsxs("div",{className:"mb-10",children:[e.jsxs("h1",{className:"font-display text-4xl md:text-5xl font-bold mb-4",children:[e.jsx("span",{className:"text-gradient-ocean",children:"Ohana"})," Community"]}),e.jsx("p",{className:"text-muted-foreground max-w-2xl",children:"Share resources, support each other, and celebrate Pacific Island culture."})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[e.jsx(P,{className:"h-5 w-5 text-coral"}),e.jsx("h2",{className:"font-display text-xl font-semibold",children:"Ohana Wall"})]}),e.jsxs("form",{onSubmit:j,className:"rounded-xl border border-primary/20 bg-card p-5 mb-6 space-y-3",children:[e.jsx(y,{placeholder:"Your name",value:i,onChange:s=>d(s.target.value),maxLength:100}),e.jsx(A,{placeholder:"Share something with the community...",value:c,onChange:s=>m(s.target.value),maxLength:500,rows:3}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.length,"/500"]}),e.jsxs(f,{type:"submit",size:"sm",disabled:x,className:"gap-1.5",children:[e.jsx(v,{className:"h-3.5 w-3.5"}),x?"Posting...":"Post"]})]})]}),e.jsxs("div",{className:"space-y-4",children:[l.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No posts yet â be the first!"}),l.map(s=>e.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[e.jsx("p",{className:"text-sm mb-2",children:s.content}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Posted by ",s.author_name," · ",b(s.created_at)]})]},s.id))]})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(w,{className:"h-5 w-5 text-primary"}),e.jsx("h2",{className:"font-display text-lg font-semibold",children:"Upcoming Events"})]}),e.jsx("div",{className:"space-y-3",children:M.map((s,t)=>e.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[e.jsx("h3",{className:"text-sm font-semibold",children:s.title}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[s.location," · ",s.date]})]},t))})]}),e.jsxs("div",{className:"rounded-xl border border-accent/30 bg-accent/5 p-6 text-center",children:[e.jsx("h3",{className:"font-display text-lg font-semibold mb-2",children:"Get Tattoo Guid
6ance"}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Verified artists and cultural education â find the right artist for your journey."}),e.jsx(f,{size:"sm",className:"bg-gradient-coral shadow-coral",asChild:!0,children:e.jsxs(S,{to:"/directory",children:["Find an Artist ",e.jsx(C,{className:"ml-1.5 h-3 w-3"})]})})]})]})]})]})})};export{H 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.