import { useTranslation } from "@repo/rdx-ui/locales/i18n.ts"; import type { JSX } from "react"; import { LoadingIndicator } from "./loading-indicator.tsx"; export type LoadingOverlayProps = { title?: string; subtitle?: string; }; /** * LoadingOverlay component * @param {string} title - The title to display in the loading overlay. * @param {string} subtitle - The subtitle to display in the loading overlay. * @param {React.HTMLAttributes} props - Additional props to pass to the overlay. * @returns {JSX.Element} The LoadingOverlay component. */ export const LoadingOverlay = ({ title, subtitle, ...props }: LoadingOverlayProps): JSX.Element => { const { t } = useTranslation(); const { title: defaultTitle, subtitle: defaultSubtitle } = t("components.loading_overlay", { returnObjects: true, }) as { title: string; subtitle: string }; const loadingTitle = title || defaultTitle; const loadingSubtitle = subtitle || defaultSubtitle; return (
); }; LoadingOverlay.displayName = "LoadingOverlay";