style(glossary): remove redundant buttons and links, filter already imported presets
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m26s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m26s
This commit is contained in:
@@ -255,6 +255,10 @@ export default function GlossariesPage() {
|
|||||||
);
|
);
|
||||||
}, [glossaries]);
|
}, [glossaries]);
|
||||||
|
|
||||||
|
const availableTemplates = useMemo(() => {
|
||||||
|
return templates.filter(t => !importedTemplateIds.has(t.id));
|
||||||
|
}, [templates, importedTemplateIds]);
|
||||||
|
|
||||||
const filteredGlossaries = useMemo(() => {
|
const filteredGlossaries = useMemo(() => {
|
||||||
if (!searchQuery.trim()) return glossaries;
|
if (!searchQuery.trim()) return glossaries;
|
||||||
const q = searchQuery.toLowerCase();
|
const q = searchQuery.toLowerCase();
|
||||||
@@ -294,14 +298,6 @@ export default function GlossariesPage() {
|
|||||||
{t('glossaries.description') || "Gérez vos glossaires et instructions de contexte pour des traductions plus précises."}
|
{t('glossaries.description') || "Gérez vos glossaires et instructions de contexte pour des traductions plus précises."}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<button
|
|
||||||
onClick={() => setCreateDialogOpen(true)}
|
|
||||||
disabled={isProcessing}
|
|
||||||
className="premium-button px-8 py-3 text-xs uppercase tracking-widest !rounded-xl flex items-center gap-2 disabled:opacity-50 shrink-0 cursor-pointer font-bold"
|
|
||||||
>
|
|
||||||
<Plus size={14} />
|
|
||||||
{t('glossaries.createNew') || "Créer un glossaire"}
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* ── How it works ───────────────────────────────────────── */}
|
{/* ── How it works ───────────────────────────────────────── */}
|
||||||
@@ -336,16 +332,10 @@ export default function GlossariesPage() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-4 pt-4 border-t border-brand-accent/10 flex items-center justify-between">
|
<div className="mt-4 pt-4 border-t border-brand-accent/10">
|
||||||
<p className="text-[11px] text-brand-dark/45 dark:text-white/40 font-light">
|
<p className="text-[11px] text-brand-dark/45 dark:text-white/40 font-light">
|
||||||
{t('glossaries.howItWorks.warning')}
|
{t('glossaries.howItWorks.warning')}
|
||||||
</p>
|
</p>
|
||||||
<Link
|
|
||||||
href="/dashboard/translate"
|
|
||||||
className="ml-4 shrink-0 flex items-center gap-1.5 text-[11px] font-bold text-brand-accent hover:underline"
|
|
||||||
>
|
|
||||||
{t('glossaries.howItWorks.goToTranslate')} <ExternalLink size={11} />
|
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -471,24 +461,6 @@ export default function GlossariesPage() {
|
|||||||
<span>{currentTargetInfo.flag} {currentTargetInfo.label}</span>
|
<span>{currentTargetInfo.flag} {currentTargetInfo.label}</span>
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{glossaries.length > 0 && (
|
|
||||||
<>
|
|
||||||
<button
|
|
||||||
onClick={() => setCreateDialogOpen(true)}
|
|
||||||
className="premium-button px-4 py-2 text-[11px] uppercase tracking-widest !rounded-lg inline-flex items-center gap-1.5 cursor-pointer font-bold shrink-0 shadow-sm"
|
|
||||||
>
|
|
||||||
<Plus size={12} />
|
|
||||||
{t('glossaries.createNew') || "Créer un glossaire"}
|
|
||||||
</button>
|
|
||||||
<Link
|
|
||||||
href="/dashboard/translate"
|
|
||||||
className="flex items-center gap-1.5 text-[11px] font-bold text-brand-accent hover:underline shrink-0"
|
|
||||||
>
|
|
||||||
<ExternalLink size={12} />
|
|
||||||
{t('glossaries.grid.goToTranslate')}
|
|
||||||
</Link>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -637,9 +609,15 @@ export default function GlossariesPage() {
|
|||||||
<div className="flex items-center justify-center py-12">
|
<div className="flex items-center justify-center py-12">
|
||||||
<Loader2 className="size-6 animate-spin text-brand-muted" />
|
<Loader2 className="size-6 animate-spin text-brand-muted" />
|
||||||
</div>
|
</div>
|
||||||
|
) : availableTemplates.length === 0 ? (
|
||||||
|
<div className="p-8 bg-brand-muted/20 dark:bg-white/[0.01] border border-black/5 dark:border-white/5 rounded-xl text-center w-full">
|
||||||
|
<p className="text-xs text-brand-dark/40 dark:text-white/30 font-light">
|
||||||
|
{t('glossaries.presets.allImported') || 'Tous les modèles professionnels ont été importés.'}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||||||
{templates.map((template) => {
|
{availableTemplates.map((template) => {
|
||||||
const Icon = TEMPLATE_ICONS[template.id] || BookText;
|
const Icon = TEMPLATE_ICONS[template.id] || BookText;
|
||||||
const isImported = importedTemplateIds.has(template.id);
|
const isImported = importedTemplateIds.has(template.id);
|
||||||
const isProcessingThis = importingPresetId === template.id;
|
const isProcessingThis = importingPresetId === template.id;
|
||||||
|
|||||||
Reference in New Issue
Block a user