- Deleted Date.js and FilterDate.js components as they are no longer needed. - Removed SearchDoctor.js component which was responsible for searching doctors. - Cleaned up the Head component by removing references to the deleted Date and SearchDoctor components. - Removed TurnsPage component and its associated List component, which were not utilized. - Deleted Cards and Table components from the list directory as they were not in use. - Removed user account related components including Tab, Head, and Form components. - Cleaned up bank account components including List, Item, and modal components. - Removed representation adapters and related functions that were not in use.
29 lines
673 B
JavaScript
29 lines
673 B
JavaScript
"use client";
|
|
|
|
import { ThemeProvider } from "next-themes";
|
|
import { useEffect } from "react";
|
|
import Cookies from "js-cookie";
|
|
import { setAccessToken } from "@/lib/tokenStore";
|
|
|
|
export function Providers({ children }) {
|
|
useEffect(() => {
|
|
if (!Cookies.get("userInfo")) return;
|
|
fetch("/api/auth/refresh", { method: "POST" })
|
|
.then((res) => (res.ok ? res.json() : null))
|
|
.then((data) => {
|
|
if (data?.access_token) setAccessToken(data.access_token);
|
|
})
|
|
.catch(() => {});
|
|
}, []);
|
|
|
|
return (
|
|
<ThemeProvider
|
|
attribute="data-"
|
|
defaultTheme="system"
|
|
enableSystem
|
|
>
|
|
{children}
|
|
</ThemeProvider>
|
|
);
|
|
}
|