diff --git a/src/app/configs/routesConfig.tsx b/src/app/configs/routesConfig.tsx index f5174e7..2d60c6e 100644 --- a/src/app/configs/routesConfig.tsx +++ b/src/app/configs/routesConfig.tsx @@ -9,10 +9,10 @@ import SignOutConfig from '../main/sign-out/SignOutConfig'; import Error404Page from '../main/404/Error404Page'; import ExampleConfig from '../main/example/ExampleConfig'; import ProjectDashboardAppConfig from '../main/dashboard/project/ProjectDashboardAppConfig'; - +import ProductoConfig from '../main/producto/ProductoConfig'; import InvoiceConfigs from '../main/invoice/InvoiceConfig'; -const routeConfigs: FuseRouteConfigsType = [ExampleConfig, SignOutConfig, SignInConfig, SignUpConfig, ProjectDashboardAppConfig, ...InvoiceConfigs]; +const routeConfigs: FuseRouteConfigsType = [ExampleConfig, SignOutConfig, SignInConfig, SignUpConfig, ProjectDashboardAppConfig, ProductoConfig, ...InvoiceConfigs]; /** * The routes of the application. diff --git a/src/app/main/producto/Producto.tsx b/src/app/main/producto/Producto.tsx index 1960f34..d79e9f9 100644 --- a/src/app/main/producto/Producto.tsx +++ b/src/app/main/producto/Producto.tsx @@ -2,6 +2,7 @@ import DemoContent from '@fuse/core/DemoContent'; import FusePageSimple from '@fuse/core/FusePageSimple'; import { useTranslation } from 'react-i18next'; import { styled } from '@mui/material/styles'; +import ListDetalleProductoRender from './widgets/DetalleProductoRender'; const Root = styled(FusePageSimple)(({ theme }) => ({ '& .FusePageSimple-header': { @@ -25,6 +26,9 @@ function Producto() {

{t('PRODUCTOS')}

} + content={ + + } /> ) } diff --git a/src/app/main/producto/widgets/DetalleProductoRender.tsx b/src/app/main/producto/widgets/DetalleProductoRender.tsx new file mode 100644 index 0000000..f5d0143 --- /dev/null +++ b/src/app/main/producto/widgets/DetalleProductoRender.tsx @@ -0,0 +1,206 @@ +import * as React from 'react'; +import FuseSvgIcon from "@fuse/core/FuseSvgIcon"; +import { + Button, + IconButton, + Paper, + Table, + TableBody, + TableCell, + TableHead, + TablePagination, + TableRow, + Typography, +} from "@mui/material"; +import { useTranslation } from "react-i18next"; +import { Link } from "react-router-dom"; +import clsx from "clsx"; + +function ListDetalleProductoRender() { + const [page, setPage] = React.useState(0); + const [rowsPerPage, setRowsPerPage] = React.useState(10); + + const handleChangePage = (event: unknown, newPage: number) => { + setPage(newPage); + }; + + const handleChangeRowsPerPage = (event: React.ChangeEvent) => { + setRowsPerPage(+event.target.value); + setPage(0); + }; + + const { t } = useTranslation("products"); + const columns = [ + "Código", + "Nombre", + "Descripción", + "Stock Mínimo", + "Estado", + "Acciones" + ]; + + const rows = [ + { + artCodigo: 1, + artNombre: "Servicios Profesionales", + artDescripcion: "Prestación de servicios", + artStockMinimo: 0, + artEstado: "activo", + action: true, + }, + { + artCodigo: 2, + artNombre: "Servicios Varios", + artDescripcion: "", + artStockMinimo: 0, + artEstado: "inactivo", + action: true, + }, + { + artCodigo: 3, + artNombre: "Servicios Profesionales", + artDescripcion: "Prestación de servicios", + artStockMinimo: 0, + artEstado: "activo", + action: true, + }, + { + artCodigo: 4, + artNombre: "Servicios Varios", + artDescripcion: "", + artStockMinimo: 0, + artEstado: "inactivo", + action: true, + }, + { + artCodigo: 5, + artNombre: "Servicios Profesionales", + artDescripcion: "Prestación de servicios", + artStockMinimo: 0, + artEstado: "activo", + action: true, + }, + { + artCodigo: 6, + artNombre: "Servicios Varios", + artDescripcion: "", + artStockMinimo: 0, + artEstado: "inactivo", + action: true, + }, + ]; + + return ( + +
+
+ + {t("Detalle de productos")} + +
+
+ +
+
+
+ + + + {columns.map((column, index) => ( + + + {column} + + + ))} + + + + + {rows + .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage) + .map((row, index) => ( + + {Object.entries(row).map(([key, value]) => { + switch (key) { + case "artEstado": { + return ( + + + {value} + + + ); + } + case "action": { + return ( + +
+ + heroicons-outline:pencil-alt + +
+
+ + heroicons-outline:trash + +
+
+ ); + } + default: { + return ( + + {value} + + ); + } + } + })} +
+ ))} +
+
+ +
+
+ ) +} + +export default ListDetalleProductoRender; \ No newline at end of file diff --git a/src/app/main/producto/widgets/types/DetalleProductoType.ts b/src/app/main/producto/widgets/types/DetalleProductoType.ts new file mode 100644 index 0000000..a2a356b --- /dev/null +++ b/src/app/main/producto/widgets/types/DetalleProductoType.ts @@ -0,0 +1,14 @@ +type DetalleProductoRow = { + artCodigo: number; + artNombre: string; + artDescripcion: string; + artStockMinimo: number; + artEstado: any; +}; + +type DetalleProductoType = { + columns: string[]; + rows: DetalleProductoRow[]; +}; + +export default DetalleProductoType; \ No newline at end of file