feat(report): ConclusionPanel + NextAppointmentPicker (date | period | none)
This commit is contained in:
1 parent
71ecebfa72
commit
6b115a558e
2 files changed
+72
-4
No files matched your search
@@ -1,3 +1,37 @@
|
|||||||
export default function ConclusionPanel() {
|
import type { Report } from '@/domain/schema/report'
|
||||||
return <div>ConclusionPanel placeholder</div>
|
import Label from '@/components/ui/Label'
|
||||||
|
import Textarea from '@/components/ui/Textarea'
|
||||||
|
import NextAppointmentPicker from './NextAppointmentPicker'
|
||||||
|
|
||||||
|
export interface ConclusionPanelProps {
|
||||||
|
conclusion: string
|
||||||
|
recommendations: string
|
||||||
|
nextAppointment: Report['nextAppointment']
|
||||||
|
onChangeConclusion: (s: string) => void
|
||||||
|
onChangeRecommendations: (s: string) => void
|
||||||
|
onChangeNextAppointment: (n: Report['nextAppointment']) => void
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function ConclusionPanel({
|
||||||
|
conclusion,
|
||||||
|
recommendations,
|
||||||
|
nextAppointment,
|
||||||
|
onChangeConclusion,
|
||||||
|
onChangeRecommendations,
|
||||||
|
onChangeNextAppointment,
|
||||||
|
}: ConclusionPanelProps) {
|
||||||
|
return (
|
||||||
|
<section className="space-y-4">
|
||||||
|
<h2 className="font-serif text-xl text-[var(--color-ink)]">Conclusion & recommandations</h2>
|
||||||
|
<div>
|
||||||
|
<Label htmlFor="conclusion">Conclusion</Label>
|
||||||
|
<Textarea id="conclusion" value={conclusion} onChange={(e) => onChangeConclusion(e.target.value)} />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Label htmlFor="recommendations">Recommandations</Label>
|
||||||
|
<Textarea id="recommendations" value={recommendations} onChange={(e) => onChangeRecommendations(e.target.value)} />
|
||||||
|
</div>
|
||||||
|
<NextAppointmentPicker value={nextAppointment} onChange={onChangeNextAppointment} />
|
||||||
|
</section>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,37 @@
|
|||||||
export default function NextAppointmentPicker() {
|
import type { Report } from '@/domain/schema/report'
|
||||||
return <div>NextAppointmentPicker placeholder</div>
|
import Input from '@/components/ui/Input'
|
||||||
|
import Label from '@/components/ui/Label'
|
||||||
|
|
||||||
|
export interface NextAppointmentPickerProps {
|
||||||
|
value: Report['nextAppointment']
|
||||||
|
onChange: (next: Report['nextAppointment']) => void
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function NextAppointmentPicker({ value, onChange }: NextAppointmentPickerProps) {
|
||||||
|
const kind = value?.kind ?? 'date'
|
||||||
|
return (
|
||||||
|
<div className="space-y-2">
|
||||||
|
<Label>Prochain rendez-vous</Label>
|
||||||
|
<div className="flex gap-2 mb-2">
|
||||||
|
<label className="text-sm flex items-center gap-1">
|
||||||
|
<input type="radio" checked={kind === 'date'} onChange={() => onChange({ kind: 'date', date: '' })} />
|
||||||
|
Date
|
||||||
|
</label>
|
||||||
|
<label className="text-sm flex items-center gap-1">
|
||||||
|
<input type="radio" checked={kind === 'period'} onChange={() => onChange({ kind: 'period', text: '' })} />
|
||||||
|
Période libre
|
||||||
|
</label>
|
||||||
|
<label className="text-sm flex items-center gap-1">
|
||||||
|
<input type="radio" checked={value === undefined} onChange={() => onChange(undefined)} />
|
||||||
|
Aucun
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
{value?.kind === 'date' && (
|
||||||
|
<Input type="date" value={value.date} onChange={(e) => onChange({ kind: 'date', date: e.target.value })} />
|
||||||
|
)}
|
||||||
|
{value?.kind === 'period' && (
|
||||||
|
<Input value={value.text} placeholder="ex. dans 3 semaines" onChange={(e) => onChange({ kind: 'period', text: e.target.value })} />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user