'use client';

import React from 'react';
import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
import { AppRouterCacheProvider } from '@mui/material-nextjs/v13-appRouter';
import { CssBaseline } from '@mui/material';
import getTheme from '@/theme/theme';

type Props = {
    children: React.ReactNode;
};

const ThemeProvider = (props: Props) => {
    return (
        <AppRouterCacheProvider options={{ key: 'mui' }}>
            <MuiThemeProvider theme={getTheme()}>
                <CssBaseline />
                {props.children}
            </MuiThemeProvider>
        </AppRouterCacheProvider>
    );
};

export default ThemeProvider;
