- Adjusted indentation and formatting in login, permissions, profile, and security pages for better readability. - Enhanced the clarity of conditional statements and function calls in permissions and profile components. - Updated type definitions in vite-env.d.ts for better code structure. - Cleaned up array mapping syntax in ProductTest.php for consistency.
42 lines
993 B
TypeScript
42 lines
993 B
TypeScript
import {
|
|
Dialog,
|
|
DialogContent,
|
|
DialogHeader,
|
|
DialogTitle,
|
|
} from '@/components/ui/dialog';
|
|
|
|
type ImagePreviewModalProps = {
|
|
open: boolean;
|
|
onOpenChange: (open: boolean) => void;
|
|
src: string | null;
|
|
title?: string;
|
|
alt?: string;
|
|
};
|
|
|
|
export function ImagePreviewModal({
|
|
open,
|
|
onOpenChange,
|
|
src,
|
|
title,
|
|
alt = 'Preview',
|
|
}: ImagePreviewModalProps) {
|
|
return (
|
|
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
<DialogContent showCloseButton>
|
|
{title && (
|
|
<DialogHeader>
|
|
<DialogTitle>{title}</DialogTitle>
|
|
</DialogHeader>
|
|
)}
|
|
{src && (
|
|
<img
|
|
src={src}
|
|
alt={alt}
|
|
className="max-h-[80vh] w-full rounded-lg object-contain"
|
|
/>
|
|
)}
|
|
</DialogContent>
|
|
</Dialog>
|
|
);
|
|
}
|