mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-28 03:29:25 +01: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)
48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import useEmbedJobs from '~/hooks/useEmbedJobs'
|
|
import HorizontalBarChart from './HorizontalBarChart'
|
|
import StyledSectionHeader from './StyledSectionHeader'
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
interface ActiveEmbedJobsProps {
|
|
withHeader?: boolean
|
|
}
|
|
|
|
const ActiveEmbedJobs = ({ withHeader = false }: ActiveEmbedJobsProps) => {
|
|
const { t } = useTranslation()
|
|
const { data: jobs } = useEmbedJobs()
|
|
|
|
return (
|
|
<>
|
|
{withHeader && (
|
|
<StyledSectionHeader title={t('common.processingQueue')} className="mt-12 mb-4" />
|
|
)}
|
|
<div className="space-y-4">
|
|
{jobs && jobs.length > 0 ? (
|
|
jobs.map((job) => (
|
|
<div
|
|
key={job.jobId}
|
|
className="bg-desert-white rounded-lg p-4 border border-desert-stone-light shadow-sm hover:shadow-lg transition-shadow"
|
|
>
|
|
<HorizontalBarChart
|
|
items={[
|
|
{
|
|
label: job.fileName,
|
|
value: job.progress,
|
|
total: '100%',
|
|
used: `${job.progress}%`,
|
|
type: job.status,
|
|
},
|
|
]}
|
|
/>
|
|
</div>
|
|
))
|
|
) : (
|
|
<p className="text-text-muted">{t('common.noFilesProcessing')}</p>
|
|
)}
|
|
</div>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default ActiveEmbedJobs
|