Files
analiticaNucleo/nuxt4-app/app/components/rechazos/RechazosRechazoCard.vue
josedario87 aa76fea286 Refactor: Adaptar todos los componentes al sistema de temas
- Reemplazar colores hardcoded del tema café con variables --brand-*
  - #c08040 → var(--brand-primary-strong)
  - #d99a56 → var(--brand-primary)
  - #f0c07c → var(--brand-accent)
  - #1c140c → var(--brand-surface)
  - #3a2a16 → var(--brand-border)
  - #1b1209, #14100b → var(--brand-bg)

- Reemplazar colores de tipos de café con variables --coffee-*
  - #a855f7 → var(--coffee-uva)
  - #f97316 → var(--coffee-oreado)
  - #06b6d4 → var(--coffee-mojado)
  - #22c55e → var(--coffee-verde)

- Reemplazar clases gray-scale de Tailwind con variables de tema
  - text-gray-400, text-gray-500 → text-[var(--brand-text-muted)]
  - bg-gray-700/30 → bg-[var(--brand-surface)]

- Todos los componentes ahora responden dinámicamente a cambios de tema

Archivos adaptados:
- Páginas: error, informe-ingresos, panorama, explorer, metabase-debug, profile, notifications, settings
- Componentes de ingresos: GraficaSerieIngresos, GraficaSerieInversion, GraficaDinamicaPagadoDeposito, GraficaAcumuladoresUva, TotalesIngresoCompra, TotalesMonetarios, TotalesVerde, SecosVendidos, TopClientes, VistaTablaIngresos, VistaTablaIngresosConClientes, FiltrosActivos
- Componentes de comparativa: CosechasHeatmap, CosechasPorTipo, CosechasEvolucion, CosechasTotales
- Componentes de UI: ClienteSelector, DateRangeSelector, MetadatosCard, MaintenanceMode
- Componentes de auth: UserAvatar, UserMetadata
- Componentes de clientes: ClienteCard, VistaTablaClientes
- Componentes de rechazos: RechazoCard, RechazosRechazoCard, RechazosSubproductos
- Componentes de metabase: MetabaseCardDisplay, MetabaseCardsTable
2025-10-30 17:54:42 -06:00

83 lines
2.5 KiB
Vue

<template>
<div class="rounded-lg border border-[var(--brand-border)] bg-[var(--brand-surface)] p-4">
<div class="flex items-center justify-between mb-3">
<h3 class="text-lg font-semibold text-[var(--brand-text)]">{{ title }}</h3>
<div :class="colorClasses" class="w-3 h-3 rounded-full"></div>
</div>
<div class="space-y-2">
<div class="flex justify-between items-center">
<span class="text-xs text-[var(--brand-text-muted)]">Cantidad</span>
<span class="text-sm font-medium text-[var(--brand-text)]">
{{ formatNumber(data.total_cantidad) }} {{ unidad }}
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-xs text-[var(--brand-text-muted)]">Total Cobrado</span>
<span class="text-sm font-bold text-green-400">
{{ formatCurrency(data.total_cobrado) }}
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-xs text-[var(--brand-text-muted)]">Precio Promedio</span>
<span class="text-sm font-medium text-[var(--brand-text)]">
{{ formatCurrency(data.precio_promedio) }}
</span>
</div>
<div class="flex justify-between items-center pt-2 border-t border-[var(--brand-border)]">
<span class="text-xs text-[var(--brand-text-muted)]">Registros</span>
<span class="text-xs font-medium text-[var(--brand-text)]">
{{ data.num_registros }}
</span>
</div>
</div>
</div>
</template>
<script setup lang="ts">
const props = defineProps<{
title: string
data: {
tipo: string
num_registros: number
total_cantidad: number
total_cobrado: number
precio_promedio: number
}
unidad: string
color: string
}>()
const colorClasses = computed(() => {
const colors: Record<string, string> = {
blue: 'bg-blue-500',
green: 'bg-green-500',
yellow: 'bg-yellow-500',
red: 'bg-red-500',
purple: 'bg-purple-500',
pink: 'bg-pink-500'
}
return colors[props.color] || 'bg-gray-500'
})
const formatNumber = (value: number) => {
return new Intl.NumberFormat('es-HN', {
minimumFractionDigits: 2,
maximumFractionDigits: 2
}).format(value)
}
const formatCurrency = (value: number) => {
if (!value) return 'L 0.00'
return new Intl.NumberFormat('es-HN', {
style: 'currency',
currency: 'HNL',
minimumFractionDigits: 2,
maximumFractionDigits: 2
}).format(value).replace('HNL', 'L')
}
</script>