36 lines
946 B
TypeScript
36 lines
946 B
TypeScript
import Button from '@/components/ui/Button'
|
|
import Dialog from '@/components/ui/Dialog'
|
|
import { useT } from '@/i18n/useT'
|
|
|
|
export interface SignOutLossDialogProps {
|
|
open: boolean
|
|
onConfirm: () => void
|
|
onCancel: () => void
|
|
}
|
|
|
|
/** Warns that signing out drops the unsaved changes and this tab's local copies. */
|
|
export default function SignOutLossDialog({
|
|
open,
|
|
onConfirm,
|
|
onCancel,
|
|
}: SignOutLossDialogProps) {
|
|
const t = useT()
|
|
return (
|
|
<Dialog
|
|
open={open}
|
|
onClose={onCancel}
|
|
title={t('shell.sign_out_loss_title')}
|
|
description={t('shell.sign_out_loss_body')}
|
|
>
|
|
<div className="mt-4 flex flex-wrap justify-end gap-2">
|
|
<Button type="button" variant="ghost" onClick={onCancel}>
|
|
{t('shell.sign_out_loss_cancel')}
|
|
</Button>
|
|
<Button type="button" onClick={onConfirm}>
|
|
{t('shell.sign_out_loss_confirm')}
|
|
</Button>
|
|
</div>
|
|
</Dialog>
|
|
)
|
|
}
|