Notes for card info

This commit is contained in:
Gavin McDonald
2025-04-23 15:49:32 -04:00
parent 5b21c560d6
commit 0c8d2273ea
3 changed files with 113 additions and 0 deletions

26
components/Scrim.tsx Normal file
View File

@@ -0,0 +1,26 @@
'use client';
type ScrimProps = {
children?: React.ReactNode;
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
show?: boolean;
className?: string;
};
export default function Scrim({ children, onClick, show = true, className = '' }: ScrimProps) {
const handleClick = (event: React.MouseEvent<HTMLDivElement>) => {
if (event.target === event.currentTarget) {
onClick && onClick(event);
}
};
if (!show) return null;
return (
<div
onClick={handleClick}
className={`fixed inset-0 bg-black/20 backdrop-blur-sm z-40 ${className}`}
>
{children}
</div>
);
}