From a8fc3eb397a4fe23864b027d953f7028f6d42aac Mon Sep 17 00:00:00 2001 From: joao_pedro Date: Sat, 25 Oct 2025 17:04:39 -0300 Subject: [PATCH] Criacao manager e erro login --- .../utils/fetchErros/CabecalhoError.jsx | 17 ++++++++++++ .../utils/fetchErros/ManagerFunction.js | 16 ++++++++++++ src/components/utils/fetchErros/style.css | 26 +++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 src/components/utils/fetchErros/CabecalhoError.jsx create mode 100644 src/components/utils/fetchErros/ManagerFunction.js create mode 100644 src/components/utils/fetchErros/style.css diff --git a/src/components/utils/fetchErros/CabecalhoError.jsx b/src/components/utils/fetchErros/CabecalhoError.jsx new file mode 100644 index 00000000..1b278bb7 --- /dev/null +++ b/src/components/utils/fetchErros/CabecalhoError.jsx @@ -0,0 +1,17 @@ +import React from 'react'; +import './style.css'; + +const CabecalhoError = ({ showCabecalho, message, errorCode }) => { + if (!showCabecalho) return null; + + return ( +
+
+ +

{message}

+
+
+ ); +}; + +export default CabecalhoError; diff --git a/src/components/utils/fetchErros/ManagerFunction.js b/src/components/utils/fetchErros/ManagerFunction.js new file mode 100644 index 00000000..43890d2d --- /dev/null +++ b/src/components/utils/fetchErros/ManagerFunction.js @@ -0,0 +1,16 @@ +function manager (setShowModal, RefreshingToken, setErrorInfo,errorData) { + + console.log((errorData, "MANAGER")) + + + if(errorData.httpStatus === 401){ + RefreshingToken() + }else{ + + // setErrorInfo(errorData) + setShowModal("modal"); + } +} + + +export default manager \ No newline at end of file diff --git a/src/components/utils/fetchErros/style.css b/src/components/utils/fetchErros/style.css new file mode 100644 index 00000000..f1c2bfc6 --- /dev/null +++ b/src/components/utils/fetchErros/style.css @@ -0,0 +1,26 @@ +.cabecalho-error { + background-color: #f3616d; /* vermelho forte */ + color: white; + display: flex; + align-items: center; /* centraliza verticalmente */ + justify-content: center; /* centraliza horizontalmente */ + padding: 12px 20px; + margin: 10px; + border-radius: 8px; + font-weight: bold; + font-size: 16px; + width: calc(100% - 20px); /* ocupa quase toda a largura da div pai */ + box-sizing: border-box; +} + +.cabecalho-error-text { + margin: 0; + padding-left: 30px; /* espaço para "Erro 404" */ + position: relative; +} + +.cabecalho-error-code { + position: absolute; + left: 0; + font-weight: 700; +}