- import { AlertCircle, AlertTriangle, ChevronDown, ChevronUp, X } from 'lucide-svelte';
- import { cn } from '$lib/utils';
-
- export type ErrorPanelNoticeRow = {
- field: string;
- message: string;
- };
-
- export type ErrorPanelNoticeVariant = 'error' | 'warning';
-
- export type ErrorPanelNoticeLabels = {
- clear: string;
- columnType: string;
- columnField: string;
- columnMessage: string;
- emptyField: string;
- dismissRowAria: string;
- toggleDetailsAria: string;
- };
-
- let {
- open,
- variant = 'error',
- title,
- rows = [],
- durationMs = 12000,
- labels,
- dismissibleRows = true,
- class: className = '',
- onClose,
- onDismissRow
- }: {
- open: boolean;
- variant?: ErrorPanelNoticeVariant;
- title: string;
- rows: ErrorPanelNoticeRow[];
- durationMs?: number;
- labels: ErrorPanelNoticeLabels;
- dismissibleRows?: boolean;
- class?: string;
- onClose?: () => void;
- onDismissRow?: (index: number) => void;
- } = $props();
-
- let expanded = $state(true);
-
- const isWarning = $derived(variant === 'warning');
-
- /** Re-expand the table when the panel opens or when errors/warnings change (new batch). */
- $effect(() => {
- if (!open) return;
- void title;
- void variant;
- void JSON.stringify(rows);
- expanded = true;
- });
-
- $effect(() => {
- if (!open || durationMs <= 0) return;
- void rows.length;
- const t = setTimeout(() => onClose?.(), durationMs);
- return () => clearTimeout(t);
- });
-
- function toggleExpanded() {
- expanded = !expanded;
- }
-
-
-{#if open}
-
-
-
-
- {#if isWarning}
-
- {:else}
-
- {/if}
-
-
{title}
-
-
-
-
-
-
- {#if expanded && rows.length > 0}
-
-
-
-
- |
- {labels.columnType}
- |
-
- {labels.columnField}
- |
-
- {labels.columnMessage}
- |
- {#if dismissibleRows && onDismissRow}
- |
- {/if}
-
-
-
- {#each rows as row, i (i)}
-
- |
-
- {#if isWarning}
-
- {:else}
- ×
- {/if}
-
- |
-
- {row.field || labels.emptyField}
- |
-
- {row.message}
- |
- {#if dismissibleRows && onDismissRow}
-
-
- |
- {/if}
-
- {/each}
-
-
-
- {/if}
-
-{/if}
diff --git a/frontend/src/routes/dashboard/export/manifest/+page.svelte b/frontend/src/routes/dashboard/export/manifest/+page.svelte
index 72fcebd5..06c7f2f3 100644
--- a/frontend/src/routes/dashboard/export/manifest/+page.svelte
+++ b/frontend/src/routes/dashboard/export/manifest/+page.svelte
@@ -47,7 +47,10 @@
let showDetails = $state(false);
- const columns = createColumns();
+ const isError = $derived(!canView || status >= 400 || error);
+
+ // Pasamos canEdit y canDelete a las columnas por si tu DataTable tiene acciones por fila
+ const columns = createColumns({ canEdit, canDelete });
// --- Lifecycle ---
onMount(() => {
diff --git a/frontend/src/routes/dashboard/goods/fda-codes/+page.svelte b/frontend/src/routes/dashboard/goods/fda-codes/+page.svelte
index 9ddf117d..fb967805 100644
--- a/frontend/src/routes/dashboard/goods/fda-codes/+page.svelte
+++ b/frontend/src/routes/dashboard/goods/fda-codes/+page.svelte
@@ -393,21 +393,23 @@
-
- {#if filteredFdaList.length > 0}
-
-
- Mostrando {filteredFdaList.length} registros
-
- {#if searchQuery}
-
- Filtro: "{searchQuery}"
-
-
- {/if}
-
- {/if}
-
+ {#if filteredFdaList.length > 0}
+
+
+ Mostrando {filteredFdaList.length} registros
+
+ {#if searchQuery}
+
+ Filtro: "{searchQuery}"
+
+
+ {/if}
+
+ {/if}
+
+ {/if}