| 1 | import { useT } from '@renderer/i18n' |
| 2 | import { |
| 3 | AlertDialog, |
| 4 | AlertDialogAction, |
| 5 | AlertDialogCancel, |
| 6 | AlertDialogContent, |
| 7 | AlertDialogDescription, |
| 8 | AlertDialogTitle |
| 9 | } from '../../ui/AlertDialog' |
| 10 | |
| 11 | interface DeleteElementDialogProps { |
| 12 | open: boolean |
| 13 | onOpenChange: (open: boolean) => void |
| 14 | onConfirm: () => void |
| 15 | } |
| 16 | |
| 17 | export function DeleteElementDialog({ |
| 18 | open, |
| 19 | onOpenChange, |
| 20 | onConfirm |
| 21 | }: DeleteElementDialogProps): React.JSX.Element { |
| 22 | const t = useT() |
| 23 | |
| 24 | return ( |
| 25 | <AlertDialog open={open} onOpenChange={onOpenChange}> |
| 26 | <AlertDialogContent> |
| 27 | <AlertDialogTitle>{t('sessionDetail.deleteElement')}</AlertDialogTitle> |
| 28 | <AlertDialogDescription>{t('sessionDetail.deleteElementConfirm')}</AlertDialogDescription> |
| 29 | <div className="flex justify-end gap-2"> |
| 30 | <AlertDialogCancel>{t('common.cancel')}</AlertDialogCancel> |
| 31 | <AlertDialogAction |
| 32 | className="bg-[#c0392b] text-white hover:bg-[#a93226]" |
| 33 | onClick={onConfirm} |
| 34 | > |
| 35 | {t('common.delete')} |
| 36 | </AlertDialogAction> |
| 37 | </div> |
| 38 | </AlertDialogContent> |
| 39 | </AlertDialog> |
| 40 | ) |
| 41 | } |
| 42 |