+
+
+
(
+ { key: produto.uid, name: produto.nome, preco: produto.preco, categoria: produto.categoria.nome }
+ ))
+ }
+ pagination={{
+ position: ["bottomCenter"],
+ total: total,
+ defaultPageSize: 5,
+ onChange(page, pageSize) {
+ onChangePage(page, pageSize)
+ },
+ pageSizeOptions: [5, 10, 15],
+ showSizeChanger: true,
+ onShowSizeChange(current, size) {
+ onChangePage(current, size)
+ },
+ }}
+ loading={loading}
+ bordered={true}
+ >
+
+
+
+
+ (
+
+
+ { handleDelete(record.key) }}
+ okText="Sim"
+ cancelText="Não"
+ >
+ }
+ size="large"
+ title="Deletar"
+ />
+
+
+ } size="large"
+ title="Atualizar"
+ onClick={() => { navigate(`/cliente/new`) }}
+ />
+
+
+ } size="large"
+ title="AddCart"
+ onClick={() => { addItemCart(record) }}
+ />
+
+ )}
+ />
+
+
+
+ )
+}
+
+export default Produtos;
\ No newline at end of file
diff --git a/first-app/src/pages/Produto/produto.module.css b/first-app/src/pages/Produto/produto.module.css
new file mode 100644
index 0000000..34341f2
--- /dev/null
+++ b/first-app/src/pages/Produto/produto.module.css
@@ -0,0 +1,20 @@
+.form_produto{
+ width: 600px;
+}
+
+.container_table {
+ width: 800px;
+ display: flex;
+ flex-direction: column;
+}
+
+.container_table__filter{
+ width: 100%;
+ display: flex;
+ justify-content: space-between;
+ margin-bottom: 1em;
+}
+
+.container_table__search{
+ width: 300px;
+}
\ No newline at end of file
diff --git a/first-app/src/services/ProdutoService.ts b/first-app/src/services/ProdutoService.ts
new file mode 100644
index 0000000..4b1ca03
--- /dev/null
+++ b/first-app/src/services/ProdutoService.ts
@@ -0,0 +1,71 @@
+import { Environments } from "../environments";
+import { ParamsType } from "../interfaces/ParamsType";
+import { Produto } from "../interfaces/Produto";
+
+const URLApi = Environments.URLApi;
+
+const getAllCategorias = async () => {
+ const data = await fetch(`${URLApi}/categoria`)
+ .then((res)=>res.json())
+ .catch((err)=>err);
+
+ return data;
+}
+
+const registerProduto = async (produto:Produto) => {
+
+ const config = {
+ method:"POST",
+ body:JSON.stringify(produto),
+ headers: {
+ "Content-type":"application/json",
+ }
+ }
+
+ try {
+ const data = await fetch(`${URLApi}/produto`,config)
+ .then((res)=>res.json())
+ .catch((err)=>err);
+ return data;
+
+ } catch (error) {
+ console.info(error);
+ return error;
+ }
+}
+
+const getAllProdutos = async (params:ParamsType) => {
+
+ const config = {
+ method:"POST",
+ body:JSON.stringify(params),
+ headers: {
+ "Content-type":"application/json",
+ }
+ }
+
+ const data = await fetch (`${URLApi}/produto/list`,config)
+ .then((res)=>res.json())
+ .catch((err)=>err);
+
+ return data;
+}
+
+const deleteProduto = async (uid:string) => {
+
+ try {
+ const data = await fetch(`${URLApi}/produto?uid=${uid}`,{method:'DELETE'})
+ .then((res)=>res.json())
+ .catch((err)=> err);
+ return data;
+ } catch (error) {
+ console.info(error);
+ }
+}
+
+export const ProdutoService = {
+ getAllCategorias,
+ registerProduto,
+ getAllProdutos,
+ deleteProduto
+}
\ No newline at end of file
diff --git a/first-app/src/slices/CarrinhoSlice.ts b/first-app/src/slices/CarrinhoSlice.ts
new file mode 100644
index 0000000..af95262
--- /dev/null
+++ b/first-app/src/slices/CarrinhoSlice.ts
@@ -0,0 +1,51 @@
+import { createAsyncThunk, createSlice } from "@reduxjs/toolkit";
+import { ItemCart } from "../interfaces/ItemCart";
+import { notify } from "../hooks/useToastfy";
+
+const initialState = {
+ itens:[],
+ valorTotal:0
+}
+
+const calclQuantidade = (itens:Array