Files
codey.lol/src/components/AppLayout.jsx

39 lines
1.3 KiB
React
Raw Normal View History

2025-06-18 07:46:59 -04:00
// Root.jsx
import { toast } from 'react-toastify';
2025-06-18 11:41:03 -04:00
import { API_URL } from '../config';
import { Player } from './AudioPlayer.jsx';
import { JoyUIRootIsland } from './Components.jsx';
import { PrimeReactProvider } from "primereact/api";
2025-06-18 07:46:59 -04:00
import Alert from '@mui/joy/Alert';
import WarningIcon from '@mui/icons-material/Warning';
import CustomToastContainer from '../components/ToastProvider.jsx';
import LyricSearch from './LyricSearch.jsx';
import 'primereact/resources/themes/bootstrap4-light-blue/theme.css'; // TEMP
import 'primereact/resources/primereact.min.css';
2025-06-18 07:46:59 -04:00
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
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"></Player>)}
</JoyUIRootIsland>
</PrimeReactProvider>
);
}