ui.* catalog and the dialogs: error dialogs, confirm and paper dialogs keyed

Establishes the ui.* namespace for phases 2 and 3. Both catalogs complete, so the
key-parity test holds. Two English copy defects fixed while keying, because the
Portuguese must not inherit them: 'Your are not authorized' -> 'You are', and
'Please Signin again' -> 'Please sign in again'.

The server's own message in ServerError/CustomError stays verbatim — it is a
response, not UI copy (D1).
This commit is contained in:
2026-08-23 04:10:27 +00:00
parent a444280cb4
commit 339d31f05c
8 changed files with 183 additions and 22 deletions
@@ -1,6 +1,7 @@
import { useState } from 'react';
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import { Button } from '@/components/ui/button';
import { useTranslation } from '@/components/locales';
type ConfirmDialogProps = {
open: boolean;
@@ -16,8 +17,9 @@ type ConfirmDialogProps = {
export const ConfirmDialog = (props: ConfirmDialogProps) => {
const [confirming, setConfirming] = useState(false);
const { t } = useTranslation();
const { open, disabled = false, title, description, children } = props;
const { onConfirm, onCancel, confirmLabel = 'Confirm', confirmVariant = 'default' } = props;
const { onConfirm, onCancel, confirmLabel, confirmVariant = 'default' } = props;
const handleConfirm = async () => {
setConfirming(true);
@@ -37,16 +39,16 @@ export const ConfirmDialog = (props: ConfirmDialogProps) => {
<div className="mt-6 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
<Button type="button" variant="outline" onClick={onCancel}>
Cancel
{t('button.cancel')}
</Button>
<Button
type="button"
variant={confirmVariant}
onClick={handleConfirm}
disabled={disabled || confirming}
className="sm:ml-2"
className="sm:ms-2"
>
{confirmLabel}
{confirmLabel ?? t('button.confirm')}
</Button>
</div>
</DialogContent>