2025-12-25 19:04:45 +01:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import { layoutStyles } from "../styles/shared";
|
2025-12-25 22:06:39 +01:00
|
|
|
import { useTranslation } from "../hooks/useTranslation";
|
2025-12-25 19:04:45 +01:00
|
|
|
|
|
|
|
|
interface LoadingStateProps {
|
2025-12-25 22:06:39 +01:00
|
|
|
/** Custom loading message (default: uses translation) */
|
2025-12-25 19:04:45 +01:00
|
|
|
message?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Standard loading state component.
|
|
|
|
|
* Displays a centered loading message with consistent styling.
|
|
|
|
|
*/
|
2025-12-25 22:06:39 +01:00
|
|
|
export function LoadingState({ message }: LoadingStateProps) {
|
|
|
|
|
const t = useTranslation("common");
|
|
|
|
|
const displayMessage = message || t("loading");
|
|
|
|
|
|
2025-12-25 19:04:45 +01:00
|
|
|
return (
|
|
|
|
|
<main style={layoutStyles.main}>
|
2025-12-25 22:06:39 +01:00
|
|
|
<div style={layoutStyles.loader}>{displayMessage}</div>
|
2025-12-25 19:04:45 +01:00
|
|
|
</main>
|
|
|
|
|
);
|
|
|
|
|
}
|