feat: complete UI design system refactoring and fix TS build errors
This commit is contained in:
1 parent
0b1ffdfdfc
commit
8728308fc6
27 files changed
+847
-370
No files matched your search
@@ -3,6 +3,9 @@
|
||||
import { useState, useTransition } from "react";
|
||||
|
||||
import { archiveEditorialAction } from "@/app/admin/redaktionen/[id]/actions";
|
||||
import { Card, CardHeader, CardTitle, CardDescription, CardContent } from "@/components/ui/card";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
type DangerZoneProps = {
|
||||
editorialId: string;
|
||||
@@ -22,28 +25,36 @@ export function DangerZone({ editorialId, editorialName }: DangerZoneProps) {
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="danger-zone" aria-labelledby="danger-title">
|
||||
<h2 id="danger-title">Gefahrenzone</h2>
|
||||
<p>Alle Albumrechte werden widerrufen und der Login wird deaktiviert. Abrechnungsdaten bleiben erhalten.</p>
|
||||
<label>
|
||||
<span>Redaktionsname zur Bestätigung eingeben:</span>
|
||||
<input
|
||||
type="text"
|
||||
value={confirmText}
|
||||
onChange={(e) => setConfirmText(e.target.value)}
|
||||
placeholder={editorialName}
|
||||
className="danger-zone-input"
|
||||
disabled={isPending}
|
||||
/>
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
className="action-button action-button--danger"
|
||||
disabled={!isConfirmed || isPending}
|
||||
onClick={handleArchive}
|
||||
>
|
||||
{isPending ? "Wird archiviert…" : "Redaktion archivieren"}
|
||||
</button>
|
||||
</section>
|
||||
<Card className="border-destructive/50 bg-destructive/5 dark:bg-destructive/10">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-destructive">Gefahrenzone</CardTitle>
|
||||
<CardDescription>
|
||||
Alle Albumrechte werden widerrufen und der Login wird deaktiviert. Abrechnungsdaten bleiben erhalten.
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<label className="text-sm font-medium">
|
||||
Redaktionsname zur Bestätigung eingeben:
|
||||
</label>
|
||||
<Input
|
||||
type="text"
|
||||
value={confirmText}
|
||||
onChange={(e) => setConfirmText(e.target.value)}
|
||||
placeholder={editorialName}
|
||||
disabled={isPending}
|
||||
className="border-destructive/30 focus-visible:ring-destructive"
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
type="button"
|
||||
variant="destructive"
|
||||
disabled={!isConfirmed || isPending}
|
||||
onClick={handleArchive}
|
||||
>
|
||||
{isPending ? "Wird archiviert…" : "Redaktion archivieren"}
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user