diff --git a/src/components/doctors/DoctorForm.jsx b/src/components/doctors/DoctorForm.jsx
index 2b193ad..ac8db12 100644
--- a/src/components/doctors/DoctorForm.jsx
+++ b/src/components/doctors/DoctorForm.jsx
@@ -1,8 +1,16 @@
import React, { useState } from 'react';
-import { Link } from 'react-router-dom';
+import { Link,useNavigate, useLocation } from 'react-router-dom';
function DoctorForm({ onSave, onCancel, formData, setFormData }) {
+ const navigate = useNavigate();
+ const location = useLocation();
+ const Voltar = () => {
+ const prefixo = location.pathname.split("/")[1];
+ navigate(`/${prefixo}/medicos`);
+ }
+
+ // Funções para formatar telefone e CPF
const FormatTelefones = (valor) => {
const digits = String(valor).replace(/\D/g, '').slice(0, 11);
return digits
@@ -419,11 +427,11 @@ function DoctorForm({ onSave, onCancel, formData, setFormData }) {
>
Salvar Médico
-
-
-
-
+
+ Voltar()}>
Cancelar
-
+