import { usePlatformLanguage } from "../i18n/LanguageContext";

type LoadingIndicatorProps = {
  label?: string;
  size?: "sm" | "md";
};

export default function LoadingIndicator({ label = "i18n:govoplan-core.loading.8f26c652", size = "sm" }: LoadingIndicatorProps) {
  const { translateText } = usePlatformLanguage();
  const translatedLabel = translateText(label);
  return (
    <span className={`loading-indicator loading-indicator-${size}`} role="status" aria-label={translatedLabel} title={translatedLabel}>
      <span className="loading-envelope" aria-hidden="true" />
    </span>);

}