removed static props for PageAlert
This commit is contained in:
@@ -25,7 +25,7 @@ RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /usr/app
|
||||
|
||||
COPY --from=builder /usr/app/out/json/ .
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN pnpm install
|
||||
|
||||
# Build the project
|
||||
COPY --from=builder /usr/app/out/full/ .
|
||||
|
||||
@@ -23,7 +23,7 @@ RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /usr/app
|
||||
|
||||
COPY --from=builder /usr/app/out/json/ .
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN pnpm install
|
||||
|
||||
# Build the project
|
||||
COPY --from=builder /usr/app/out/full/ .
|
||||
|
||||
@@ -25,7 +25,7 @@ RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /usr/app
|
||||
|
||||
COPY --from=builder /usr/app/out/json/ .
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN pnpm install
|
||||
|
||||
# Build the project
|
||||
COPY --from=builder /usr/app/out/full/ .
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
FROM node:22-alpine AS base
|
||||
|
||||
ARG DATABASE_URL
|
||||
ENV DATABASE_URL=${DATABASE_URL}
|
||||
|
||||
ENV PNPM_HOME="/usr/local/pnpm"
|
||||
ENV PATH="${PNPM_HOME}:${PATH}"
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
@@ -23,7 +26,7 @@ RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /usr/app
|
||||
|
||||
COPY --from=builder /usr/app/out/json/ .
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN pnpm install
|
||||
|
||||
# Build the project
|
||||
COPY --from=builder /usr/app/out/full/ .
|
||||
|
||||
@@ -15,8 +15,8 @@ interface AppointmentModalProps {
|
||||
ref: RefObject<HTMLDialogElement | null>;
|
||||
participantModal: RefObject<HTMLDialogElement | null>;
|
||||
appointmentsTableRef: React.RefObject<PaginatedTableRef | null>;
|
||||
appointmentForm: UseFormReturn<EventAppointmentOptionalDefaults, any, undefined>;
|
||||
participantForm: UseFormReturn<Participant, any, undefined>;
|
||||
appointmentForm: UseFormReturn<EventAppointmentOptionalDefaults>;
|
||||
participantForm: UseFormReturn<Participant>;
|
||||
}
|
||||
|
||||
export const AppointmentModal = ({
|
||||
|
||||
@@ -1,36 +1,34 @@
|
||||
import { DatabaseBackupIcon, PartyPopperIcon } from 'lucide-react';
|
||||
import { PaginatedTable } from '../../../_components/PaginatedTable';
|
||||
import Link from 'next/link';
|
||||
import { PartyPopperIcon } from "lucide-react";
|
||||
import { PaginatedTable } from "../../../_components/PaginatedTable";
|
||||
import Link from "next/link";
|
||||
|
||||
export default () => {
|
||||
return (
|
||||
<>
|
||||
<PaginatedTable
|
||||
showEditButton
|
||||
prismaModel="event"
|
||||
columns={[
|
||||
{
|
||||
header: 'Name',
|
||||
accessorKey: 'name',
|
||||
},
|
||||
{
|
||||
header: 'Versteckt',
|
||||
accessorKey: 'hidden',
|
||||
},
|
||||
]}
|
||||
leftOfSearch={
|
||||
<span className="flex items-center gap-2">
|
||||
<PartyPopperIcon className="w-5 h-5" /> Events
|
||||
</span>
|
||||
}
|
||||
rightOfSearch={
|
||||
<Link href={'/admin/event/new'}>
|
||||
<button className="btn btn-sm btn-outline btn-primary">
|
||||
Erstellen
|
||||
</button>
|
||||
</Link>
|
||||
}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default function Page() {
|
||||
return (
|
||||
<>
|
||||
<PaginatedTable
|
||||
showEditButton
|
||||
prismaModel="event"
|
||||
columns={[
|
||||
{
|
||||
header: "Name",
|
||||
accessorKey: "name",
|
||||
},
|
||||
{
|
||||
header: "Versteckt",
|
||||
accessorKey: "hidden",
|
||||
},
|
||||
]}
|
||||
leftOfSearch={
|
||||
<span className="flex items-center gap-2">
|
||||
<PartyPopperIcon className="w-5 h-5" /> Events
|
||||
</span>
|
||||
}
|
||||
rightOfSearch={
|
||||
<Link href={"/admin/event/new"}>
|
||||
<button className="btn btn-sm btn-outline btn-primary">Erstellen</button>
|
||||
</Link>
|
||||
}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import type { Metadata } from "next";
|
||||
import {
|
||||
DiscordLogoIcon,
|
||||
InstagramLogoIcon,
|
||||
ReaderIcon,
|
||||
} from "@radix-ui/react-icons";
|
||||
import { DiscordLogoIcon, InstagramLogoIcon, ReaderIcon } from "@radix-ui/react-icons";
|
||||
import { HorizontalNav, VerticalNav } from "../_components/Nav";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { redirect } from "next/navigation";
|
||||
import { getServerSession } from "../api/auth/[...nextauth]/auth";
|
||||
import { headers } from "next/headers";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Create Next App",
|
||||
@@ -65,9 +60,7 @@ export default async function RootLayout({
|
||||
</div>
|
||||
|
||||
{/* Center: Copyright */}
|
||||
<p className="text-sm">
|
||||
Copyright © {new Date().getFullYear()} - Virtual Air Rescue
|
||||
</p>
|
||||
<p className="text-sm">Copyright © {new Date().getFullYear()} - Virtual Air Rescue</p>
|
||||
|
||||
{/* Right: Social Icons */}
|
||||
<div className="flex gap-4">
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
import { PaginatedTable } from "../../../_components/PaginatedTable";
|
||||
|
||||
export default async () => {
|
||||
return (
|
||||
<>
|
||||
<PaginatedTable
|
||||
prismaModel="user"
|
||||
searchFields={["publicId", "firstname", "lastname", "email"]}
|
||||
columns={[
|
||||
{
|
||||
header: "Station",
|
||||
accessorKey: "station",
|
||||
},
|
||||
{
|
||||
header: "Alarmzeit",
|
||||
accessorKey: "alarm",
|
||||
},
|
||||
{
|
||||
header: "Status 3",
|
||||
accessorKey: "s3",
|
||||
},
|
||||
{
|
||||
header: "Status 4",
|
||||
accessorKey: "s4",
|
||||
},
|
||||
{
|
||||
header: "Status 7",
|
||||
accessorKey: "s7",
|
||||
},
|
||||
{
|
||||
header: "Status 8",
|
||||
accessorKey: "s8",
|
||||
},
|
||||
{
|
||||
header: "Status 1",
|
||||
accessorKey: "s1",
|
||||
},
|
||||
{
|
||||
header: "Flugzeit",
|
||||
accessorKey: "fz",
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -1,7 +1,6 @@
|
||||
import { NotebookText } from "lucide-react";
|
||||
import LogbookTable from "./_components/LogbookTable";
|
||||
|
||||
export default () => {
|
||||
const page = () => {
|
||||
return (
|
||||
<div className="grid grid-cols-6 gap-4">
|
||||
<div className="col-span-full">
|
||||
@@ -10,8 +9,10 @@ export default () => {
|
||||
</p>
|
||||
</div>
|
||||
<div className="card bg-base-200 shadow-xl mb-4 col-span-6">
|
||||
<LogbookTable />
|
||||
<h2 className="text-2xl text-gray-600 ">W.I.P.</h2>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default page;
|
||||
|
||||
@@ -5,16 +5,6 @@ import Events from "./_components/Events";
|
||||
import { Stats } from "./_components/Stats";
|
||||
import { Badges } from "./_components/Badges";
|
||||
|
||||
/*
|
||||
✔️ Einlog-Zeit
|
||||
✔️ Stats
|
||||
✔️ Pilot / Disponent TODO: Selection persistent machen
|
||||
Map - I dont know man, passt hier vielleicht nicht rein
|
||||
Logbuch / Einsatzhistorie
|
||||
Badges
|
||||
Aktive Events / Mandatory Events
|
||||
*/
|
||||
|
||||
export default async function Home({
|
||||
searchParams,
|
||||
}: {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { prisma } from "@repo/db";
|
||||
import { MessageCircleWarning } from "lucide-react";
|
||||
const fetchMainMessage = async () => {
|
||||
return await prisma.notam.findFirst({
|
||||
where: {
|
||||
@@ -8,45 +9,33 @@ const fetchMainMessage = async () => {
|
||||
});
|
||||
};
|
||||
|
||||
const mainMessage = await fetchMainMessage();
|
||||
export const WarningAlert = async () => {
|
||||
const mainMessage = await fetchMainMessage();
|
||||
|
||||
let msgColor;
|
||||
switch (mainMessage?.color) {
|
||||
case "WARNING":
|
||||
msgColor = "alert alert-warning ml-3";
|
||||
break;
|
||||
case "INFO":
|
||||
msgColor = "alert alert-info ml-3";
|
||||
break;
|
||||
case "SUCCESS":
|
||||
msgColor = "alert alert-success ml-3";
|
||||
break;
|
||||
case "ERROR":
|
||||
msgColor = "alert alert-error ml-3";
|
||||
break;
|
||||
default:
|
||||
msgColor = "alert ml-3";
|
||||
}
|
||||
let msgColor;
|
||||
switch (mainMessage?.color) {
|
||||
case "WARNING":
|
||||
msgColor = "alert alert-warning ml-3";
|
||||
break;
|
||||
case "INFO":
|
||||
msgColor = "alert alert-info ml-3";
|
||||
break;
|
||||
case "SUCCESS":
|
||||
msgColor = "alert alert-success ml-3";
|
||||
break;
|
||||
case "ERROR":
|
||||
msgColor = "alert alert-error ml-3";
|
||||
break;
|
||||
default:
|
||||
msgColor = "alert ml-3";
|
||||
}
|
||||
|
||||
export const WarningAlert = () => {
|
||||
if (mainMessage?.message == "" || !mainMessage) {
|
||||
return <></>;
|
||||
} else {
|
||||
return (
|
||||
<div role="alert" className={msgColor}>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="h-6 w-6 shrink-0 stroke-current"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth="2"
|
||||
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
||||
/>
|
||||
</svg>
|
||||
<MessageCircleWarning />
|
||||
<span className="font-bold">{mainMessage?.message}</span>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -5,7 +5,7 @@ services:
|
||||
dockerfile: ./apps/dispatch/Dockerfile
|
||||
container_name: dispatch
|
||||
ports:
|
||||
- "3001:3001"
|
||||
- "3001:3000"
|
||||
env_file:
|
||||
- .env.prod
|
||||
networks:
|
||||
|
||||
Reference in New Issue
Block a user