import { motion, AnimatePresence } from "framer-motion"; import React from "react"; import { TextButton } from "./Buttons/TextButton"; import { useEffect } from "react"; export const useDisableBodyScroll = (open: boolean) => { useEffect(() => { if (open) { document.body.style.overflow = "hidden"; } else { document.body.style.overflow = "unset"; } }, [open]); }; interface DialogProps { show: boolean; children?: React.ReactNode; } interface OptionalChidrenProps { children?: React.ReactNode; } type DialogHeadlineProps = OptionalChidrenProps; type DialogSupportingTextProps = OptionalChidrenProps; type DialogButtonGroupProps = OptionalChidrenProps; interface DialogButtonProps extends OptionalChidrenProps { onClick?: React.MouseEventHandler; } export const DialogHeadline: React.FC = ({ children }: DialogHeadlineProps) => { return

{children}

; }; export const DialogSupportingText: React.FC = ({ children }: DialogHeadlineProps) => { return
{children}
; }; export const DialogButton: React.FC = ({ children, onClick }: DialogButtonProps) => { return {children}; }; export const DialogButtonGroup: React.FC = ({ children }: DialogButtonGroupProps) => { return
{children}
; }; export const Dialog: React.FC = ({ show, children }: DialogProps) => { useDisableBodyScroll(show); return ( {show && (
)}
); };