'use client'; import { Grid, Paper, Text, Radio, useMantineTheme, Timeline, Flex, Select, Popover, SimpleGrid, } from '@mantine/core'; import { IconInfoCircle, IconPointFilled } from '@tabler/icons-react'; import React, { useState } from 'react'; import { regulations } from '../../utils/utils'; import { useDisclosure } from '@mantine/hooks'; function ConsentBannerScreen(props: any) { const theme = useMantineTheme(); const [regulation] = useState(props?.regulation || regulations[0]); const [layoutType, setLayoutType] = useState( props?.consentConfig?.layout || 'Box' ); const [bannerValue, setBannerValue] = useState( props?.consentConfig?.alignment || 'leftBottomPopUp' ); const [openedContent, { open: openContent, close: closeContent }] = useDisclosure(false); // For content drawer const layouts = [ { layoutType: 'Box', bannerValue: 'leftBottomPopUp', styles: { border: '1px solid #eaeaea', padding: '10px', position: 'absolute', backgroundColor: theme.colors[theme.primaryColor][6], width: '40%', left: bannerValue === 'leftBottomPopUp' || bannerValue === 'leftTopPopUp' ? '7px' : 'auto', right: bannerValue === 'rightBottomPopUp' || bannerValue === 'rightTopPopUp' ? '7px' : 'auto', bottom: bannerValue === 'leftBottomPopUp' || bannerValue === 'rightBottomPopUp' ? '7px' : 'auto', top: bannerValue === 'leftTopPopUp' || bannerValue === 'rightTopPopUp' ? '7px' : 'auto', }, text: 'Box', }, { layoutType: 'Banner', bannerValue: 'bannerBottom', styles: { border: '1px solid #eaeaea', backgroundColor: theme.colors[theme.primaryColor][6], left: '5px', bottom: '7px', padding: '5px', position: 'absolute', width: '80%', }, text: 'Banner', }, { layoutType: 'PopUp', bannerValue: 'popUpCenter', styles: { border: '1px solid #eaeaea', backgroundColor: theme.colors[theme.primaryColor][6], left: '30%', bottom: '30%', padding: '10px', position: 'absolute', width: '40%', }, text: 'Popup', }, ]; const handleConsentBannerChange = ( fieldName: any, value: any, regulationObj: any ) => { props.handleLayout(fieldName, value, regulationObj); }; return ( <> } > Consent Template