import { useStoreActions, useStoreState } from '@/state' import { MoonIcon, SunIcon } from '@heroicons/react/20/solid' import { Switch } from '@mantine/core' import { ReactNode, useEffect, useRef } from 'react' import { CSSTransition } from 'react-transition-group' import ContentContainer from '@/components/elements/ContentContainer' import FlashMessageRender from '@/components/elements/FlashMessageRenderer' export interface PageContentBlockProps { title?: string className?: string showFlashKey?: string children?: ReactNode } const PageContentBlock = ({ title, showFlashKey, className, children, }: PageContentBlockProps) => { const theme = useStoreState(state => state.settings.data!.theme) const setTheme = useStoreActions(actions => actions.settings.setTheme) const ref = useRef(null) useEffect(() => { if (title) { document.title = title } }, [title]) return (
{showFlashKey && ( )} {children}

© 2020 - {new Date().getFullYear()}{' '} Performave

setTheme(theme === 'light' ? 'dark' : 'light') } onLabel={} offLabel={ } />
) } export default PageContentBlock