feat: Implement remaining data widgets for Agro, Grains, and USA Stocks

This commit is contained in:
2025-07-01 13:42:16 -03:00
parent 4cfb248f54
commit c4eead1033
5 changed files with 243 additions and 23 deletions

View File

@@ -1,16 +1,6 @@
import {
Box,
CircularProgress,
Alert,
Table,
TableBody,
TableCell,
TableContainer,
TableHead,
TableRow,
Paper,
Typography,
Tooltip
Box, CircularProgress, Alert, Table, TableBody, TableCell,
TableContainer, TableHead, TableRow, Paper, Typography, Tooltip
} from '@mui/material';
import type { CotizacionBolsa } from '../models/mercadoModels';
import { useApiData } from '../hooks/useApiData';
@@ -30,7 +20,7 @@ const formatNumber = (num: number) => {
const Variacion = ({ value }: { value: number }) => {
const color = value > 0 ? 'success.main' : value < 0 ? 'error.main' : 'text.secondary';
const Icon = value > 0 ? ArrowUpwardIcon : value < 0 ? ArrowDownwardIcon : RemoveIcon;
return (
<Box component="span" sx={{ display: 'flex', alignItems: 'center', justifyContent: 'center', color }}>
<Icon sx={{ fontSize: '1rem', mr: 0.5 }} />
@@ -84,9 +74,9 @@ export const BolsaLocalWidget = () => {
))}
</TableBody>
</Table>
<Tooltip title={`Última actualización: ${new Date(data[0].fechaRegistro).toLocaleString('es-AR')}`}>
<Tooltip title={`Última actualización: ${new Date(data[0].fechaRegistro).toLocaleString('es-AR')}`}>
<Typography variant="caption" sx={{ p: 1, display: 'block', textAlign: 'right', color: 'text.secondary' }}>
Fuente: Yahoo Finance
Fuente: Yahoo Finance
</Typography>
</Tooltip>
</TableContainer>