'use client';

import ClientSideWrapper from '@/components/wrapper/ClientSideWrapper';
import React from 'react';
import { usePathname } from 'next/navigation';
import clsx from 'clsx';

function DialogsLayout({ children }: { children: React.ReactNode }) {
    const pathname = usePathname();
    const isCheckoutPage = pathname?.includes('/checkout/');

    return (
        <ClientSideWrapper>
            <main className={clsx(
                'h-full dark:bg-background w-full overflow-y-auto noscrollbar pt-4 pb-6 px-6',
                isCheckoutPage
                    ? 'bg-background dark:bg-background'
                    : 'bg-container lg:bg-background'
            )}>
                {children}
            </main>
        </ClientSideWrapper>
    )
}

export default DialogsLayout