feat(app): sign-out warns before losing editor work, local copies purged
This commit is contained in:
1 parent
8b6adcb7df
commit
bd4ba338af
12 files changed
+417
-16
No files matched your search
@@ -0,0 +1,35 @@
|
||||
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>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user