import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; import { AlertTriangle } from 'lucide-react'; interface SessionWarningProps { open: boolean; countdownSeconds: number; onExtend: () => void; onLogout: () => void; } /** * Warning dialog shown before automatic session timeout. * Gives the user an opportunity to extend their session. */ export function SessionWarning({ open, countdownSeconds, onExtend, onLogout, }: SessionWarningProps) { const minutes = Math.floor(countdownSeconds / 60); const seconds = countdownSeconds % 60; const timeDisplay = `${minutes}:${seconds.toString().padStart(2, '0')}`; return ( {}}> e.preventDefault()}> Session Expiring Soon Your session will expire in{' '} {timeDisplay} {' '} due to inactivity.
If you do not extend your session, you will be logged out automatically and any unsaved work may be lost.
); }