mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 22:11:11 -05:00
Refactor code structure and remove redundant changes
This commit is contained in:
53
src-old/components/settings/SessionRevokeConfirmDialog.tsx
Normal file
53
src-old/components/settings/SessionRevokeConfirmDialog.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from '@/components/ui/alert-dialog';
|
||||
|
||||
interface Props {
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
onConfirm: () => void;
|
||||
isCurrentSession: boolean;
|
||||
}
|
||||
|
||||
export function SessionRevokeConfirmDialog({
|
||||
open,
|
||||
onOpenChange,
|
||||
onConfirm,
|
||||
isCurrentSession
|
||||
}: Props) {
|
||||
return (
|
||||
<AlertDialog open={open} onOpenChange={onOpenChange}>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Revoke Session?</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
{isCurrentSession ? (
|
||||
<>
|
||||
This is your current session. Revoking it will sign you out immediately
|
||||
and you'll need to log in again.
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
This will immediately end the selected session. The device using that
|
||||
session will be signed out.
|
||||
</>
|
||||
)}
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction onClick={onConfirm} className="bg-destructive hover:bg-destructive/90">
|
||||
{isCurrentSession ? 'Sign Out' : 'Revoke Session'}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user