"use client";

import { cn } from "@/lib/utils";
import { useI18n } from "@/lib/i18n";

export function LoadingSkeleton({ className = "" }: { className?: string }) {
  const { t } = useI18n();
  return <div className={cn("animate-pulse rounded-[1.75rem] bg-white/40 dark:bg-white/10", className)} aria-label={t("common.loading")} />;
}

export function PageLoadingSkeleton() {
  return (
    <div className="space-y-5" aria-busy="true">
      <LoadingSkeleton className="h-[25rem]" />
      <div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
        {Array.from({ length: 4 }, (_, index) => <LoadingSkeleton className="h-36" key={index} />)}
      </div>
    </div>
  );
}
