11import { ArrowDownCircle , ArrowUpCircle } from 'lucide-react' ;
22
3- const movimientos = [
4- {
5- tipo : 'Entrada' ,
6- producto : 'Botón Z6' ,
7- cantidad : 500 ,
8- fecha : '2025-08-02' ,
9- icono : < ArrowDownCircle className = "text-green-600 w-5 h-5" /> ,
10- } ,
11- {
12- tipo : 'Salida' ,
13- producto : 'Botón R4' ,
14- cantidad : 300 ,
15- fecha : '2025-08-02' ,
16- icono : < ArrowUpCircle className = "text-red-600 w-5 h-5" /> ,
17- } ,
18- {
19- tipo : 'Entrada' ,
20- producto : 'Botón L2' ,
21- cantidad : 200 ,
22- fecha : '2025-08-01' ,
23- icono : < ArrowDownCircle className = "text-green-600 w-5 h-5" /> ,
24- } ,
25- {
26- tipo : 'Salida' ,
27- producto : 'Botón M1' ,
28- cantidad : 100 ,
29- fecha : '2025-07-31' ,
30- icono : < ArrowUpCircle className = "text-red-600 w-5 h-5" /> ,
31- } ,
32- {
33- tipo : 'Entrada' ,
34- producto : 'Botón Z1' ,
35- cantidad : 200 ,
36- fecha : '2025-08-01' ,
37- icono : < ArrowDownCircle className = "text-green-600 w-5 h-5" /> ,
38- } ,
39- {
40- tipo : 'Entrada' ,
41- producto : 'Botón Z1' ,
42- cantidad : 1000 ,
43- fecha : '2025-08-02' ,
44- icono : < ArrowDownCircle className = "text-green-600 w-5 h-5" /> ,
45- } ,
46- // Puedes duplicar más para probar el scroll
47- ] ;
3+ // const movimientos = [
4+ // {
5+ // tipo: 'Entrada',
6+ // producto: 'Botón Z6',
7+ // cantidad: 500,
8+ // fecha: '2025-08-02',
9+ // icono: <ArrowDownCircle className="text-green-600 w-5 h-5" />,
10+ // },
11+ // {
12+ // tipo: 'Salida',
13+ // producto: 'Botón R4',
14+ // cantidad: 300,
15+ // fecha: '2025-08-02',
16+ // icono: <ArrowUpCircle className="text-red-600 w-5 h-5" />,
17+ // },
18+ // {
19+ // tipo: 'Entrada',
20+ // producto: 'Botón L2',
21+ // cantidad: 200,
22+ // fecha: '2025-08-01',
23+ // icono: <ArrowDownCircle className="text-green-600 w-5 h-5" />,
24+ // },
25+ // {
26+ // tipo: 'Salida',
27+ // producto: 'Botón M1',
28+ // cantidad: 100,
29+ // fecha: '2025-07-31',
30+ // icono: <ArrowUpCircle className="text-red-600 w-5 h-5" />,
31+ // },
32+ // {
33+ // tipo: 'Entrada',
34+ // producto: 'Botón Z1',
35+ // cantidad: 200,
36+ // fecha: '2025-08-01',
37+ // icono: <ArrowDownCircle className="text-green-600 w-5 h-5" />,
38+ // },
39+ // {
40+ // tipo: 'Entrada',
41+ // producto: 'Botón Z1',
42+ // cantidad: 1000,
43+ // fecha: '2025-08-02',
44+ // icono: <ArrowDownCircle className="text-green-600 w-5 h-5" />,
45+ // },
46+ // // Puedes duplicar más para probar el scroll
47+ // ];
4848
49- export default function MovimientosRecientesBL ( ) {
49+ export default function MovimientosRecientesBL ( { movimientos} ) {
50+ console . log ( 'movimientos' , movimientos ) ;
5051 return (
5152 < div className = "relative flex flex-col h-full p-5" >
5253 { /* Header */ }
@@ -57,23 +58,35 @@ export default function MovimientosRecientesBL() {
5758 { /* Lista scrollable */ }
5859 < div className = "flex-1 overflow-y-auto pr-1" >
5960 < ul className = "space-y-4 text-sm text-gray-800 dark:text-gray-300" >
60- { movimientos . map ( ( mov , i ) => (
61- < li key = { i } className = "flex items-center justify-between" >
62- < div className = "flex items-center gap-3" >
63- < div className = "bg-gray-100 dark:bg-gray-800 p-2 rounded-full" >
64- { mov . icono }
65- </ div >
66- < div >
67- < p className = "font-medium" > { mov . tipo } : { mov . producto } </ p >
68- < p className = "text-xs text-gray-500 dark:text-gray-400" >
69- Cantidad: { mov . cantidad }
70- </ p >
61+ { Object . values ( movimientos ) . map ( ( mov , i ) => {
62+ let icono ;
63+ if ( mov . tipo === "entrada" ) {
64+ icono = < ArrowUpCircle className = "text-green-600 w-5 h-5" /> ;
65+ } else {
66+ icono = < ArrowDownCircle className = "text-red-600 w-5 h-5" /> ;
67+ }
68+
69+ return (
70+ < li key = { i } className = "flex items-center justify-between" >
71+ < div className = "flex items-center gap-3" >
72+ < div className = "bg-gray-100 dark:bg-gray-800 p-2 rounded-full" >
73+ { icono }
74+ </ div >
75+ < div >
76+ < p className = "font-medium" >
77+ { mov . tipo } : { mov ?. empaque ?. producto ?. descripcion }
78+ </ p >
79+ < p className = "text-xs text-gray-500 dark:text-gray-400" >
80+ Fecha: { mov . created_at . slice ( 0 , 10 ) }
81+ </ p >
82+ </ div >
7183 </ div >
72- </ div >
73- < div className = "text-xs text-gray-500 dark:text-gray-400" > { mov . fecha } </ div >
74- </ li >
75- ) ) }
84+ < div className = "text-xs text-gray-500 dark:text-gray-400" > { mov . fecha } </ div >
85+ </ li >
86+ ) ;
87+ } ) }
7688 </ ul >
89+
7790 </ div >
7891 </ div >
7992 ) ;
0 commit comments