added Badges to Dashboard, warning for full events

This commit is contained in:
PxlLoewe
2025-03-10 23:29:02 -07:00
parent c01e618a56
commit 92dff8f3c9
20 changed files with 141 additions and 31 deletions

View File

@@ -69,7 +69,13 @@ export const AppointmentModal = ({
})}
className="flex flex-col"
>
<DateInput control={appointmentForm.control} name="appointmentDate" />
<DateInput
control={appointmentForm.control}
name="appointmentDate"
showTimeInput
timeCaption="Uhrzeit"
showTimeCaption
/>
{/* <Input
form={appointmentForm}
type="datetime-local"

View File

@@ -81,7 +81,7 @@ export const Form = ({ event }: { event?: Event }) => {
onSubmit={form.handleSubmit(async (values) => {
setLoading(true);
const createdEvent = await upsertEvent(values, event?.id);
await upsertEvent(values, event?.id);
setLoading(false);
if (!event) redirect(`/admin/event`);
})}
@@ -201,7 +201,7 @@ export const Form = ({ event }: { event?: Event }) => {
header: "Datum",
accessorKey: "appointmentDate",
accessorFn: (date) =>
new Date(date.appointmentDate).toLocaleDateString(),
new Date(date.appointmentDate).toLocaleString(),
},
{
header: "Presenter",

View File

@@ -4,6 +4,7 @@ import { Participant, Prisma } from "@repo/db";
import { UseFormReturn } from "react-hook-form";
import { upsertParticipant } from "../../../events/actions";
import { RefObject } from "react";
import { deleteParticipant } from "../action";
interface ParticipantModalProps {
participantForm: UseFormReturn<Participant>;
@@ -59,6 +60,17 @@ export const ParticipantModal = ({
))}
</div>
<Button type="submit">Speichern</Button>
<Button
type="button"
onSubmit={() => false}
onClick={() => {
deleteParticipant(participantForm.watch("id"));
participantForm.reset();
ref.current?.close();
}}
>
Löschen
</Button>
</form>
</div>
</dialog>