import { Theme } from '@radix-ui/themes';
import './app.css';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { RouterProvider, createRouter } from '@tanstack/react-router';
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { routeTree } from './routeTree.gen';

import '@radix-ui/themes/styles.css';

const queryClient = new QueryClient({});

const router = createRouter({
	routeTree,
	context: {
		queryClient,
	},
});

declare module '@tanstack/react-router' {
	interface Register {
		router: typeof router;
	}
}

createRoot(document.getElementById('root')!).render(
	<StrictMode>
		<QueryClientProvider client={queryClient}>
			<Theme
				appearance="dark"
				panelBackground="solid"
				accentColor="ruby"
				grayColor="auto"
				// radius="full"
				radius="large"
			>
				<RouterProvider router={router} />
			</Theme>
		</QueryClientProvider>
	</StrictMode>,
);
