- Lessons module: lesson types, instructors, schedule slots, enrollments, sessions (list + week grid view), lesson plans, grading scales, templates - Rate cycles: replace monthly_rate with billing_interval + billing_unit on enrollments; add weekly/monthly/quarterly rate presets to lesson types and schedule slots with auto-fill on enrollment form - Member detail page: tabbed layout for details, identity documents, enrollments - Sessions week view: custom 7-column grid replacing react-big-calendar - Music store seed: instructors, lesson types, slots, enrollments, sessions, grading scale, lesson plan template - Scrollbar styling: themed to match sidebar/app palette - deploy/: EC2 setup and redeploy scripts, nginx config, systemd service - Help: add Lessons category (overview, types, instructors, slots, enrollments, sessions, plans/grading); collapsible sidebar with independent scroll; remove POS/accounting references from docs
42 lines
1.5 KiB
TypeScript
42 lines
1.5 KiB
TypeScript
import { useForm } from 'react-hook-form'
|
|
import { Button } from '@/components/ui/button'
|
|
import { Input } from '@/components/ui/input'
|
|
import { Label } from '@/components/ui/label'
|
|
|
|
interface Props {
|
|
onSubmit: (data: Record<string, unknown>) => void
|
|
loading?: boolean
|
|
}
|
|
|
|
export function StoreClosureForm({ onSubmit, loading }: Props) {
|
|
const { register, handleSubmit } = useForm({
|
|
defaultValues: { name: '', startDate: '', endDate: '' },
|
|
})
|
|
|
|
function handleFormSubmit(data: { name: string; startDate: string; endDate: string }) {
|
|
onSubmit({ name: data.name, startDate: data.startDate, endDate: data.endDate })
|
|
}
|
|
|
|
return (
|
|
<form onSubmit={handleSubmit(handleFormSubmit)} className="space-y-4">
|
|
<div className="space-y-2">
|
|
<Label htmlFor="closure-name">Name *</Label>
|
|
<Input id="closure-name" {...register('name')} placeholder="e.g. Thanksgiving Break" required />
|
|
</div>
|
|
<div className="grid grid-cols-2 gap-4">
|
|
<div className="space-y-2">
|
|
<Label htmlFor="closure-start">Start Date *</Label>
|
|
<Input id="closure-start" type="date" {...register('startDate')} required />
|
|
</div>
|
|
<div className="space-y-2">
|
|
<Label htmlFor="closure-end">End Date *</Label>
|
|
<Input id="closure-end" type="date" {...register('endDate')} required />
|
|
</div>
|
|
</div>
|
|
<Button type="submit" disabled={loading} className="w-full">
|
|
{loading ? 'Saving...' : 'Add Closure'}
|
|
</Button>
|
|
</form>
|
|
)
|
|
}
|