Go-Backend (chi, pgx, golang-migrate) + React/TS-Frontend als PWA. Enthalten: Auth inkl. OIDC, Dateien mit Versionen und Papierkorb, Freigaben (Links + intern), WebDAV, Gruppenordner, Admin/Theming, Volltextsuche mit OCR, eigener PDF-Betrachter und WOPI-Office (Collabora/OnlyOffice). Nicht im Repo: deploy/.env (Sitzungsschlüssel, DB- und Admin-Passwort) sowie alle Daten- und Build-Verzeichnisse – siehe .gitignore. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
56 lines
1.9 KiB
TypeScript
56 lines
1.9 KiB
TypeScript
import { useOverlayDismiss } from '../hooks/useOverlayDismiss'
|
|
|
|
interface Props {
|
|
title: string
|
|
message: string
|
|
confirmLabel?: string
|
|
danger?: boolean
|
|
onConfirm: () => void
|
|
onCancel: () => void
|
|
}
|
|
|
|
export default function ConfirmDialog({ title, message, confirmLabel = 'Confirm', danger = false, onConfirm, onCancel }: Props) {
|
|
const overlay = useOverlayDismiss(onCancel)
|
|
return (
|
|
<div
|
|
style={{ position: 'fixed', inset: 0, zIndex: 200, display: 'flex', alignItems: 'center', justifyContent: 'center', background: 'rgba(0,0,0,0.6)' }}
|
|
{...overlay}
|
|
>
|
|
<div style={{
|
|
background: 'var(--color-surface)',
|
|
border: '1px solid var(--color-border)',
|
|
borderRadius: 14,
|
|
padding: 24,
|
|
width: 360,
|
|
maxWidth: '90vw',
|
|
}}>
|
|
<h2 style={{ margin: '0 0 8px', fontSize: 16, fontWeight: 600, color: 'var(--color-text)' }}>{title}</h2>
|
|
<p style={{ margin: '0 0 24px', fontSize: 14, color: 'var(--color-text-muted)', lineHeight: 1.5 }}>{message}</p>
|
|
<div style={{ display: 'flex', gap: 8, justifyContent: 'flex-end' }}>
|
|
<button
|
|
onClick={onCancel}
|
|
style={{
|
|
padding: '8px 16px', borderRadius: 8,
|
|
border: '1px solid var(--color-border)',
|
|
background: 'transparent', color: 'var(--color-text-muted)',
|
|
fontSize: 13, cursor: 'pointer',
|
|
}}
|
|
>
|
|
Cancel
|
|
</button>
|
|
<button
|
|
onClick={onConfirm}
|
|
style={{
|
|
padding: '8px 16px', borderRadius: 8, border: 'none',
|
|
background: danger ? 'var(--color-danger)' : 'var(--color-primary)',
|
|
color: '#fff', fontSize: 13, fontWeight: 600, cursor: 'pointer',
|
|
}}
|
|
>
|
|
{confirmLabel}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|