Skip to content

Commit

Permalink
Arreglos estéticos
Browse files Browse the repository at this point in the history
  • Loading branch information
samuop committed Sep 19, 2024
1 parent 4cc13d7 commit be3582a
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions FrontAdmin/src/components/Pages/Sysacad/ExcelSysacad/Resultado.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,43 @@
import datos from '../../../../API/Sysacad.ts';
import { useState, useEffect, JSXElementConstructor, Key, ReactElement, ReactNode, ReactPortal } from 'react';
import { Stack, Flex, Text, Link } from '@chakra-ui/react';

import {
Tag,
TagLabel,
TagLeftIcon,
TagRightIcon,
TagCloseButton,
} from '@chakra-ui/react'

function Resultado({ data }: { data: any }) {

if (data.length === 0) {
console.log("No hay datos")
if (!data || Object.keys(data).length === 0) {
return null;
}

const { excel, duplicates, message, total } = data;
let excel, duplicates, message, total;

if ('excel' in data && 'duplicates' in data && 'message' in data && 'total' in data) {
({ excel, duplicates, message, total } = data);
} else {

return (
<Stack mt={3}>
<Text fontSize="xl" fontWeight="bold">Se encontraron errores en:</Text>
{Object.keys(data).map((key) => (

<Tag colorScheme='red' fontSize="md" fontWeight="bold">Línea: {parseInt(key, 10)}</Tag>

))}
</Stack>
);
}

return (
<Stack mt={7}>
<Stack mt={3}>
<Text fontSize="xl" fontWeight="bold">Datos cargados</Text>
<Text>Duplicados: {duplicates}</Text>
<Text>Mensaje: {message}</Text>
<Text>Total: {total}</Text>
<Tag colorScheme='green' fontSize="md" fontWeight="bold">Duplicados: {duplicates}</Tag>

<Tag colorScheme='green' fontSize="md" fontWeight="bold">Total: {total}</Tag>
</Stack>
);
}
Expand Down

0 comments on commit be3582a

Please sign in to comment.