import { supabaseAdmin } from '@/lib/supabase';
export default async function Admin(){
 const sb=supabaseAdmin(); const {data:orders}=await sb.from('orders').select('*').order('created_at',{ascending:false}).limit(50);
 return <main className="container"><h1>Admin orders</h1><div className="grid">{orders?.map((o:any)=><div className="card" key={o.id}><b>{o.name}</b><p>{o.email}</p><p>Status: {o.status} / betaling: {o.payment_status}</p><p>Stijl: {o.style}</p>{o.preview_url&&<a className="btn" href={o.preview_url}>Bekijk preview</a>}</div>)}</div></main>
}
