import { Outlet, useSearchParams } from 'react-router-dom';

import Footerbar from '@/components/Footerbar';
import Topbar from '@/components/Topbar';

const BasicLayout = () => {
    const [searchParams] = useSearchParams();
    const isEmbedded = searchParams.get('embed') === '1';

    return (
        <div className="min-h-full bg-black flex flex-col">
            {!isEmbedded && <Topbar />}
            <main className={isEmbedded ? 'flex-1 min-h-0' : 'pt-[81px] flex-1 min-h-0'}>
                <Outlet />
            </main>
            {!isEmbedded && <Footerbar />}
        </div>
    );
};

export default BasicLayout;
