Files
analiticaNucleo/nuxt4-app/app/components/MetricBox.vue
josedario87 63c7043664
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 47s
Feat: Agregar botones de Copiar Texto y Copiar JSON
Implementa funcionalidad de copia en tres secciones del Informe:

📋 Funcionalidades agregadas:
1. Lista de Ingresos
   - Copiar Texto: Formato WhatsApp con emojis y legible
   - Copiar JSON: Formato estructurado para sistemas

2. Top 10 Clientes
   - Copiar Texto: Ranking formateado con métricas
   - Copiar JSON: Array de objetos con datos completos

3. Serie Temporal Acumulada
   - Copiar Texto: Evolución temporal con emojis
   - Copiar JSON: Datos completos para análisis

 Características:
- Botones con iconos (i-lucide-copy y i-lucide-code)
- Disabled cuando no hay datos disponibles
- Alertas de confirmación al copiar
- Formato texto optimizado para WhatsApp
- Incluye metadata: rango de fechas y timestamp

Uso:
- Copiar Texto → Compartir en WhatsApp/Telegram
- Copiar JSON → Integración con otros sistemas
2025-10-30 16:33:54 -06:00

28 lines
735 B
Vue

<template>
<div class="rounded-lg border border-[var(--brand-border)] bg-[var(--brand-surface)] px-4 py-3">
<div class="text-xs text-[var(--brand-text-muted)] uppercase tracking-wide mb-1">{{ label }}</div>
<div class="text-lg font-bold" :class="valueColor">
{{ value }}
</div>
</div>
</template>
<script setup lang="ts">
const props = defineProps<{
label: string
value: string
color?: 'default' | 'green' | 'yellow' | 'red' | 'blue'
}>()
const valueColor = computed(() => {
const colors = {
default: 'text-[var(--brand-text)]',
green: 'text-green-400',
yellow: 'text-yellow-400',
red: 'text-red-400',
blue: 'text-blue-400'
}
return colors[props.color || 'default']
})
</script>