"use client";

import type { ReactNode } from "react";
import { useTheme } from "@/hooks/useTheme";

export function ThemeProvider({ children }: { children: ReactNode }) {
  const { loading } = useTheme();

  if (loading) {
    return (
      <div className="flex min-h-screen items-center justify-center bg-[var(--color-primary-soft)]">
        <div className="h-10 w-10 animate-spin rounded-full border-4 border-primary border-t-transparent" />
      </div>
    );
  }

  return <>{children}</>;
}
