import React, { useState } from 'react'; import { Plus, Calendar, Clock, Users, AlertCircle } from 'lucide-react'; import { Button, Card, Badge, Table } from '../../../../components/ui'; import type { TableColumn } from '../../../../components/ui'; import { PageHeader } from '../../../../components/layout'; import { ProductionSchedule, BatchTracker, QualityControl } from '../../../../components/domain/production'; const ProductionPage: React.FC = () => { const [activeTab, setActiveTab] = useState('schedule'); const mockProductionStats = { dailyTarget: 150, completed: 85, inProgress: 12, pending: 53, efficiency: 78, quality: 94, }; const mockProductionOrders = [ { id: '1', recipeName: 'Pan de Molde Integral', quantity: 20, status: 'in_progress', priority: 'high', assignedTo: 'Juan Panadero', startTime: '2024-01-26T06:00:00Z', estimatedCompletion: '2024-01-26T10:00:00Z', progress: 65, }, { id: '2', recipeName: 'Croissants de Mantequilla', quantity: 50, status: 'pending', priority: 'medium', assignedTo: 'María González', startTime: '2024-01-26T08:00:00Z', estimatedCompletion: '2024-01-26T12:00:00Z', progress: 0, }, { id: '3', recipeName: 'Baguettes Francesas', quantity: 30, status: 'completed', priority: 'medium', assignedTo: 'Carlos Ruiz', startTime: '2024-01-26T04:00:00Z', estimatedCompletion: '2024-01-26T08:00:00Z', progress: 100, }, ]; const getStatusBadge = (status: string) => { const statusConfig = { pending: { color: 'yellow', text: 'Pendiente' }, in_progress: { color: 'blue', text: 'En Proceso' }, completed: { color: 'green', text: 'Completado' }, cancelled: { color: 'red', text: 'Cancelado' }, }; const config = statusConfig[status as keyof typeof statusConfig]; return {config.text}; }; const getPriorityBadge = (priority: string) => { const priorityConfig = { low: { color: 'gray', text: 'Baja' }, medium: { color: 'yellow', text: 'Media' }, high: { color: 'orange', text: 'Alta' }, urgent: { color: 'red', text: 'Urgente' }, }; const config = priorityConfig[priority as keyof typeof priorityConfig]; return {config.text}; }; const columns: TableColumn[] = [ { key: 'recipeName', title: 'Receta', dataIndex: 'recipeName', render: (value) => (
{value}
), }, { key: 'quantity', title: 'Cantidad', dataIndex: 'quantity', render: (value) => `${value} unidades`, }, { key: 'status', title: 'Estado', dataIndex: 'status', render: (value) => getStatusBadge(value), }, { key: 'priority', title: 'Prioridad', dataIndex: 'priority', render: (value) => getPriorityBadge(value), }, { key: 'assignedTo', title: 'Asignado a', dataIndex: 'assignedTo', render: (value) => (
{value}
), }, { key: 'progress', title: 'Progreso', dataIndex: 'progress', render: (value) => (
{value}%
), }, { key: 'estimatedCompletion', title: 'Tiempo Estimado', dataIndex: 'estimatedCompletion', render: (value) => new Date(value).toLocaleTimeString('es-ES', { hour: '2-digit', minute: '2-digit' }), }, { key: 'actions', title: 'Acciones', align: 'right' as const, render: () => (
), }, ]; return (
Nueva Orden de Producción } /> {/* Production Stats */}

Meta Diaria

{mockProductionStats.dailyTarget}

Completado

{mockProductionStats.completed}

En Proceso

{mockProductionStats.inProgress}

Pendiente

{mockProductionStats.pending}

Eficiencia

{mockProductionStats.efficiency}%

Calidad

{mockProductionStats.quality}%

{/* Tabs Navigation */}
{/* Tab Content */} {activeTab === 'schedule' && (

Órdenes de Producción

)} {activeTab === 'batches' && ( )} {activeTab === 'quality' && ( )} ); }; export default ProductionPage;