z1amez's picture
v.1
2dddd1f
import * as React from "react"
import { cn } from "../../lib/utils"
import { X } from "lucide-react"
export interface ModalProps {
isOpen: boolean;
onClose: () => void;
title?: string;
children: React.ReactNode;
className?: string;
}
export function Modal({ isOpen, onClose, title, children, className }: ModalProps) {
if (!isOpen) return null;
return (
<div className="fixed inset-0 z-[100] bg-black/80 flex items-center justify-center p-4 sm:p-0 backdrop-blur-sm shadow-2xl">
<div className={cn("bg-neutral-900 border border-white/10 shadow-2xl rounded-2xl w-full max-w-lg overflow-hidden animate-in fade-in zoom-in-95 duration-200", className)}>
<div className="flex items-center justify-between p-4 border-b border-white/5">
{title && <h2 className="text-lg font-semibold text-white">{title}</h2>}
<button onClick={onClose} className="rounded-full p-1.5 hover:bg-white/10 transition-colors text-neutral-400 hover:text-white ml-auto">
<X className="w-5 h-5" />
</button>
</div>
<div className="p-4 sm:p-6 overflow-y-auto max-h-[80vh]">
{children}
</div>
</div>
</div>
)
}