Spaces:
Build error
Build error
Upload src/app/planner/page.tsx
Browse files- src/app/planner/page.tsx +50 -0
src/app/planner/page.tsx
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client'
|
| 2 |
+
import { useState } from 'react'
|
| 3 |
+
|
| 4 |
+
const tasks = [
|
| 5 |
+
{ id:'1', task:'Book venue', status:'completed', date:'Nov 1', cat:'Venue' },
|
| 6 |
+
{ id:'2', task:'Finalize guest list', status:'completed', date:'Nov 5', cat:'Planning' },
|
| 7 |
+
{ id:'3', task:'Sign photographer contract', status:'active', date:'Nov 15', cat:'Contract' },
|
| 8 |
+
{ id:'4', task:'Choose floral arrangements', status:'active', date:'Nov 20', cat:'Décor' },
|
| 9 |
+
{ id:'5', task:'Book caterer tasting', status:'upcoming', date:'Dec 1', cat:'Catering' },
|
| 10 |
+
{ id:'6', task:'Order wedding invitations', status:'upcoming', date:'Dec 10', cat:'Stationery' },
|
| 11 |
+
]
|
| 12 |
+
|
| 13 |
+
const budget = [
|
| 14 |
+
{ cat:'Venue', budgeted:550000, spent:400000 },
|
| 15 |
+
{ cat:'Photography', budgeted:150000, spent:0 },
|
| 16 |
+
{ cat:'Catering', budgeted:250000, spent:25000 },
|
| 17 |
+
{ cat:'Florals', budgeted:80000, spent:0 },
|
| 18 |
+
{ cat:'Music & DJ', budgeted:75000, spent:75000 },
|
| 19 |
+
]
|
| 20 |
+
|
| 21 |
+
export default function PlannerPage() {
|
| 22 |
+
const [guests, setGuests] = useState(180)
|
| 23 |
+
const totalBudget = budget.reduce((s,b)=>s+b.budgeted,0)
|
| 24 |
+
const totalSpent = budget.reduce((s,b)=>s+b.spent,0)
|
| 25 |
+
const done = tasks.filter(t=>t.status==='completed').length
|
| 26 |
+
|
| 27 |
+
return (
|
| 28 |
+
<div className="min-h-screen bg-ivory-50">
|
| 29 |
+
<div className="wedding-section py-8">
|
| 30 |
+
<div className="flex items-center justify-between mb-8">
|
| 31 |
+
<div><h1 className="font-heading text-3xl font-semibold text-charcoal-700">My Planner</h1><p className="text-charcoal-400 mt-1">{done}/{tasks.length} tasks completed</p></div>
|
| 32 |
+
<button className="wedding-btn-primary text-sm">+ Add Task</button>
|
| 33 |
+
</div>
|
| 34 |
+
<div className="grid lg:grid-cols-3 gap-6">
|
| 35 |
+
<div className="lg:col-span-2 space-y-6">
|
| 36 |
+
<div className="wedding-card p-6">
|
| 37 |
+
<h2 className="font-heading text-xl font-semibold text-charcoal-700 mb-4">Task Checklist</h2>
|
| 38 |
+
<div className="space-y-3">{tasks.map(t=><div key={t.id} className="flex items-center gap-3 py-3 border-b border-ivory-100 last:border-0"><div className={"w-6 h-6 rounded-full border-2 flex items-center justify-center shrink-0 "+(t.status==='completed'?'bg-sage-500 border-sage-500':t.status==='active'?'border-gold-400 bg-gold-50':'border-charcoal-200 bg-white')}>{t.status==='completed'?<span className="text-white text-xs">✓</span>:t.status==='active'?<span className="text-gold-500 text-xs">●</span>:null}</div><div className="flex-1"><p className={"text-sm font-medium "+(t.status==='completed'?'text-charcoal-300 line-through':'text-charcoal-700')}>{t.task}</p><p className="text-xs text-charcoal-400">{t.date} · {t.cat}</p></div><span className={"wedding-badge text-xs "+(t.status==='completed'?'bg-sage-50 text-sage-600':t.status==='active'?'bg-gold-50 text-gold-600':'bg-ivory-100 text-charcoal-400')}>{t.status==='completed'?'Done':t.status==='active'?'Active':'Upcoming'}</span></div>)}</div>
|
| 39 |
+
</div>
|
| 40 |
+
</div>
|
| 41 |
+
<div className="space-y-6">
|
| 42 |
+
<div className="wedding-card p-6"><h2 className="font-heading text-xl font-semibold text-charcoal-700 mb-4">Budget Tracker</h2><div className="text-center mb-4"><p className="text-3xl font-heading font-semibold text-charcoal-700">₨{(totalBudget/1000).toFixed(0)}K</p><p className="text-xs text-charcoal-400 mt-1">₨{(totalSpent/1000).toFixed(0)}K spent ({Math.round(totalSpent/totalBudget*100)}%)</p></div><div className="w-full bg-ivory-200 rounded-full h-2 mb-4"><div className="bg-gradient-to-r from-gold-300 to-gold-500 h-2 rounded-full" style={{width:`${(totalSpent/totalBudget)*100}%`}}/></div>{budget.map(b=><div key={b.cat}><div className="flex justify-between text-xs mb-1"><span className="text-charcoal-600">{b.cat}</span><span className="text-charcoal-400">₨{(b.spent/1000).toFixed(0)}K / ₨{(b.budgeted/1000).toFixed(0)}K</span></div><div className="w-full bg-ivory-100 rounded-full h-1.5"><div className={"h-1.5 rounded-full "+(b.spent>=b.budgeted?'bg-rose-400':'bg-sage-400')} style={{width:`${Math.min(b.spent/b.budgeted*100,100)}%`}}/></div></div>)}</div>
|
| 43 |
+
<div className="wedding-card p-6"><h2 className="font-heading text-xl font-semibold text-charcoal-700 mb-4">Guest Count</h2><div className="text-center"><p className="text-5xl font-heading font-semibold text-charcoal-700">{guests}</p><p className="text-sm text-charcoal-400 mt-1">expected guests</p><div className="flex items-center justify-center gap-4 mt-4"><button onClick={()=>setGuests(Math.max(1,guests-10))} className="w-10 h-10 rounded-full border border-ivory-200 text-charcoal-400">−</button><input type="number" value={guests} onChange={e=>setGuests(Math.max(1,parseInt(e.target.value)||1))} className="w-20 text-center wedding-input"/><button onClick={()=>setGuests(guests+10)} className="w-10 h-10 rounded-full border border-ivory-200 text-charcoal-400">+</button></div></div></div>
|
| 44 |
+
<a href="/contracts" className="block wedding-btn-outline w-full text-sm text-center">View Contracts →</a>
|
| 45 |
+
</div>
|
| 46 |
+
</div>
|
| 47 |
+
</div>
|
| 48 |
+
</div>
|
| 49 |
+
)
|
| 50 |
+
}
|