import React from 'react';
import ReactDOM from 'react-dom/client';
import { QueryClientProvider } from '@tanstack/react-query';
import { ConfigProvider } from 'antd';
import daDK from 'antd/locale/da_DK';
import dayjs from 'dayjs';
import 'dayjs/locale/da';

import App from './App';
import { queryClient } from './api/client';
import { theme } from './styles/theme';
import './styles/global.css';

// Set dayjs locale globally
dayjs.locale('da');

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <QueryClientProvider client={queryClient}>
      <ConfigProvider theme={theme} locale={daDK}>
        <App />
      </ConfigProvider>
    </QueryClientProvider>
  </React.StrictMode>
);
