import { cn } from "@repo/shadcn-ui/lib/utils"; import { useTranslation } from "../../locales/i18n.ts"; import { LoadingSpinIcon } from "./loading-spin-icon.tsx"; export type LoadingIndicatorProps = { look?: "dark" | string; size?: number; active?: boolean; title?: string; subtitle?: string; }; export const LoadingIndicator = ({ active = true, look = "dark", title, subtitle = "", }: LoadingIndicatorProps) => { const { t } = useTranslation(); const isDark = look === "dark"; const loadingSpinClassName = isDark ? "text-brand" : "text-white"; if (!active) { return; } return (
{subtitle || t("components.loading_indicator.subtitle")}
) : null}