This commit is contained in:
Gavin McDonald
2025-04-25 16:19:40 -04:00
parent f6749f3146
commit f7d10a9b4f
4 changed files with 8 additions and 8 deletions

View File

@@ -1,16 +1,16 @@
'use client';
type ScrimProps = {
children?: React.ReactNode;
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
children: React.ReactNode;
clickAction: (event: React.MouseEvent<HTMLDivElement>) => void;
show?: boolean;
className?: string;
};
export default function Scrim({ children, onClick, show = true, className = '' }: ScrimProps) {
export default function Scrim({ children, clickAction, show = true, className = '' }: ScrimProps) {
const handleClick = (event: React.MouseEvent<HTMLDivElement>) => {
if (event.target === event.currentTarget) {
onClick && onClick(event);
clickAction(event);
}
};
if (!show) return null;