ADD: fixed sime routing issues and docker file issues

This commit is contained in:
hwinkel
2026-03-13 13:18:47 +01:00
parent b3684c86b5
commit cf66d914de
7 changed files with 32 additions and 9 deletions
+22 -1
View File
@@ -1,6 +1,27 @@
import { Links, Meta, Outlet, Scripts, ScrollRestoration } from "react-router";
import { Links, Meta, Outlet, Scripts, ScrollRestoration, isRouteErrorResponse, useRouteError } from "react-router";
import "./app.css";
export function ErrorBoundary() {
const error = useRouteError();
const message = isRouteErrorResponse(error)
? `${error.status} ${error.statusText}`
: error instanceof Error
? error.message
: String(error);
const stack = error instanceof Error ? error.stack : undefined;
return (
<html lang="de">
<head><meta charSet="utf-8" /><Meta /><Links /></head>
<body style={{ fontFamily: "monospace", padding: "2rem", background: "#fff1f2", color: "#9f1239" }}>
<h1 style={{ fontSize: "1.5rem", fontWeight: 700, marginBottom: "1rem" }}>Fehler</h1>
<pre style={{ whiteSpace: "pre-wrap", wordBreak: "break-word", background: "#ffe4e6", padding: "1rem", borderRadius: "0.5rem" }}>{message}</pre>
{stack && <pre style={{ marginTop: "1rem", fontSize: "0.75rem", color: "#64748b", whiteSpace: "pre-wrap" }}>{stack}</pre>}
<Scripts />
</body>
</html>
);
}
export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="de">
@@ -16,7 +16,7 @@ import { Button } from "@/components/ui/button";
import { InvoiceStatusBadge } from "@/components/invoice/invoice-status-badge";
import { formatCurrency, formatDate } from "@/lib/tax";
import { ChevronLeft, Download, CheckCircle, Send, Trash2, RotateCcw } from "lucide-react";
import { InvoiceStatus } from "@prisma/client";
import type { InvoiceStatus } from "@prisma/client";
export async function loader({
request,
@@ -161,7 +161,7 @@ export default function InvoiceDetailPage() {
</Button>
)}
{invoice.status === "DRAFT" && (
<Button size="sm" onClick={() => updateStatus(InvoiceStatus.SENT)} disabled={loading}>
<Button size="sm" onClick={() => updateStatus("SENT")} disabled={loading}>
<Send className="h-4 w-4" /> Als versendet markieren
</Button>
)}
@@ -169,7 +169,7 @@ export default function InvoiceDetailPage() {
<Button
size="sm"
className="bg-green-600 hover:bg-green-700"
onClick={() => updateStatus(InvoiceStatus.PAID)}
onClick={() => updateStatus("PAID")}
disabled={loading}
>
<CheckCircle className="h-4 w-4" /> Als bezahlt markieren