Files
codey.lol/src/components/AppLayout.jsx
2025-07-24 10:06:36 -04:00

40 lines
1.3 KiB
JavaScript

// Root.jsx
import { toast } from 'react-toastify';
import { API_URL } from '../config';
import { Player } from './AudioPlayer.jsx';
import Memes from './Memes.jsx';
import { JoyUIRootIsland } from './Components.jsx';
import { PrimeReactProvider } from "primereact/api";
import CustomToastContainer from '../components/ToastProvider.jsx';
import LyricSearch from './LyricSearch.jsx';
import 'primereact/resources/themes/bootstrap4-light-blue/theme.css';
import 'primereact/resources/primereact.min.css';
export default function Root({child}) {
window.toast = toast;
window.API_URL = API_URL;
const theme = document.documentElement.getAttribute("data-theme")
// console.log(opts.children);
return (
<PrimeReactProvider>
<CustomToastContainer
theme={theme}
newestOnTop={true}
closeOnClick={true}/>
<JoyUIRootIsland>
{/* <Alert
className="alert"
startDecorator={<WarningIcon />}
variant="soft"
color="danger">
Work in progress... bugs are to be expected.
</Alert> */}
{child == "LyricSearch" && (<LyricSearch client:only="react" />)}
{child == "Player" && (<Player client:only="react" />)}
{child == "Memes" && <Memes client:only="react" />}
</JoyUIRootIsland>
</PrimeReactProvider>
);
}