diff --git a/src/components/buttons/event-form.tsx b/src/components/buttons/event-form.tsx index da13425..7114d26 100644 --- a/src/components/buttons/event-form.tsx +++ b/src/components/buttons/event-form.tsx @@ -9,6 +9,7 @@ import { useGetApiUserMe, usePostApiEvent, } from '@/generated/api/default/default'; +import ParticipantListEntry from '@/components/custom-ui/participantListEntry'; type eventFormProps = { type?: 'create' | 'edit'; @@ -22,6 +23,10 @@ export default function EventForm({ type = 'edit' }: eventFormProps) { const [startTime, setStartTime] = React.useState('12:00'); const [endDate, setEndDate] = React.useState(); const [endTime, setEndTime] = React.useState('13:00'); + const [selectedParticipants, setSelectedParticipants] = React.useState<{ [name: string]: boolean }>({ + 'Max Muster': false, + // Add more participants as needed + }); async function handleSubmit(e: React.FormEvent) { e.preventDefault(); @@ -161,8 +166,17 @@ export default function EventForm({ type = 'edit' }: eventFormProps) {
- {' '} - {/* TODO: add participants input */} + {/* TODO: add participants input */} + + setSelectedParticipants(prev => ({ + ...prev, + ['Max Muster']: checked, + })) + } + >
diff --git a/src/components/custom-ui/participantListEntry.tsx b/src/components/custom-ui/participantListEntry.tsx new file mode 100644 index 0000000..e893541 --- /dev/null +++ b/src/components/custom-ui/participantListEntry.tsx @@ -0,0 +1,25 @@ +import React from 'react'; + +type ParticipantListEntryProps = { + participant: string; + checked?: boolean; + onCheck?: (checked: boolean) => void; +}; + +export default function ParticipantListEntry({ + participant, + checked = false, + onCheck, +}: ParticipantListEntryProps) { + return ( +
+ onCheck?.(e.target.checked)} + className='accent-primary cursor-pointer' + /> + {participant} +
+ ); +}