import React, { PropsWithChildren, useEffect } from 'react' import { useTheme } from 'next-themes' import { motion as m } from 'framer-motion' import BottomBar from '@/containers/Layout/BottomBar' import RibbonNav from '@/containers/Layout/Ribbon' import TopBar from '@/containers/Layout/TopBar' import { useMainViewState } from '@/hooks/useMainViewState' const BaseLayout = (props: PropsWithChildren) => { const { children } = props const { mainViewState } = useMainViewState() const { theme } = useTheme() // Force set theme native useEffect(() => { async function setTheme() { switch (theme) { case 'light': return await window?.electronAPI.setNativeThemeLight() case 'dark': return await window?.electronAPI.setNativeThemeDark() default: return await window?.electronAPI.setNativeThemeSystem() } } setTheme() }, [theme]) return (
{children}
) } export default BaseLayout