mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-30 13:39:25 +02:00
- Add i18next, react-i18next, i18next-browser-languagedetector packages - Configure i18n initialization with language detector in lib/i18n.ts - Created en/de translation files and moved most hard-coded strings into the files and translated them - Uses locale-aware date formatting where applicable - Added language-specific Wikipedia content files (wikipedia.en.json, wikipedia.de.json) and updated download URLs - Added NOMAD_REPO_URL env variable for fork-friendly URL resolution (easier testing and rollout independent of Crosstalk repo)
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import { useTranslation } from 'react-i18next'
|
|
|
|
interface LoadingSpinnerProps {
|
|
text?: string
|
|
fullscreen?: boolean
|
|
iconOnly?: boolean
|
|
light?: boolean
|
|
className?: string
|
|
}
|
|
|
|
const LoadingSpinner: React.FC<LoadingSpinnerProps> = ({
|
|
text,
|
|
fullscreen = true,
|
|
iconOnly = false,
|
|
light = false,
|
|
className,
|
|
}) => {
|
|
const { t } = useTranslation()
|
|
if (!fullscreen) {
|
|
return (
|
|
<div className="flex flex-col items-center justify-center">
|
|
<div
|
|
className={`w-8 h-8 border-[3px] ${light ? 'border-white' : 'border-text-muted'} border-t-transparent rounded-full animate-spin ${className || ''}`}
|
|
></div>
|
|
{!iconOnly && (
|
|
<div className={light ? 'text-white mt-2' : 'text-text-primary mt-2'}>
|
|
{text || t('common.loadingEllipsis')}
|
|
</div>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<div className={className}>
|
|
<div className="ui active inverted dimmer">
|
|
<div className="ui text loader">{!iconOnly && <span>{text || t('common.loading')}</span>}</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default LoadingSpinner
|