removed ui, docs package

This commit is contained in:
PxlLoewe
2025-05-24 13:07:55 -07:00
parent cbeae274a4
commit 5187ed194c
44 changed files with 214 additions and 933 deletions

View File

@@ -1,32 +1,17 @@
"use client";
import { useEffect } from "react";
import {
CheckCircledIcon,
CalendarIcon,
EnterIcon,
} from "@radix-ui/react-icons";
import { Event, EventAppointment, Participant, prisma, User } from "@repo/db";
import { CheckCircledIcon, CalendarIcon, EnterIcon } from "@radix-ui/react-icons";
import { Event, EventAppointment, Participant, User } from "@repo/db";
import { cn } from "../../../../helper/cn";
import { inscribeToMoodleCourse, upsertParticipant } from "../actions";
import {
Check,
Clock10Icon,
Cross,
EyeIcon,
MessageCircleWarning,
TriangleAlert,
} from "lucide-react";
import { Check, Clock10Icon, EyeIcon, TriangleAlert } from "lucide-react";
import { useForm } from "react-hook-form";
import {
ParticipantOptionalDefaults,
ParticipantOptionalDefaultsSchema,
} from "@repo/db/zod";
import { ParticipantOptionalDefaults, ParticipantOptionalDefaultsSchema } from "@repo/db/zod";
import { zodResolver } from "@hookform/resolvers/zod";
import { Select } from "../../../_components/ui/Select";
import toast from "react-hot-toast";
import { useRouter } from "next/navigation";
import { eventCompleted } from "@repo/ui";
import { se } from "date-fns/locale";
import { eventCompleted } from "../../../../helper/events";
interface ModalBtnProps {
title: string;
@@ -91,12 +76,11 @@ const ModalBtn = ({
const selectedAppointment = selectedAppointments[0];
const selectedDate = dates.find(
(date) =>
date.id === selectAppointmentForm.watch("eventAppointmentId") ||
selectedAppointment?.id,
date.id === selectAppointmentForm.watch("eventAppointmentId") || selectedAppointment?.id,
);
const ownIndexInParticipantList = (selectedDate as any)?.Participants?.findIndex(
(p: Participant) => p.userId === user.id,
);
const ownIndexInParticipantList = (
selectedDate as any
)?.Participants?.findIndex((p: Participant) => p.userId === user.id);
const ownPlaceInParticipantList =
ownIndexInParticipantList === -1
@@ -154,9 +138,7 @@ const ModalBtn = ({
)}
{}
{!dates.length && (
<p className="text-center text-info">
Keine Termine verfügbar
</p>
<p className="text-center text-info">Keine Termine verfügbar</p>
)}
</div>
)}
@@ -174,13 +156,9 @@ const ModalBtn = ({
role="alert"
className="py-4 my-5 flex items-center gap-2 justify-center border alert alert-error alert-outline"
>
<TriangleAlert
className="h-6 w-6 shrink-0 stroke-current"
fill="none"
/>
Dieser Termin ist ausgebucht, wahrscheinlich wirst du nicht
teilnehmen können. (Listenplatz: {ownPlaceInParticipantList}{" "}
, max. {event.maxParticipants})
<TriangleAlert className="h-6 w-6 shrink-0 stroke-current" fill="none" />
Dieser Termin ist ausgebucht, wahrscheinlich wirst du nicht teilnehmen können.
(Listenplatz: {ownPlaceInParticipantList} , max. {event.maxParticipants})
</p>
)}
{selectedAppointment && !participant?.appointmentCancelled && (
@@ -188,11 +166,7 @@ const ModalBtn = ({
<div className="flex items-center gap-2 justify-center">
<p>Dein Ausgewähler Termin</p>
<p>
{new Date(
selectedAppointment.appointmentDate,
).toLocaleString()}
</p>
<p>{new Date(selectedAppointment.appointmentDate).toLocaleString()}</p>
<button
onClick={async () => {
await upsertParticipant({
@@ -204,8 +178,7 @@ const ModalBtn = ({
{
data: {
appointmentId: selectedAppointment.id,
appointmentDate:
selectedAppointment.appointmentDate,
appointmentDate: selectedAppointment.appointmentDate,
},
user: `${user?.firstname} ${user?.lastname} - ${user?.publicId}`,
event: "Termin abgesagt",