diff options
| author | zwlucas <lucas.oliveira1676@etec.sp.gov.br> | 2025-04-01 17:30:52 +0000 |
|---|---|---|
| committer | zwlucas <lucas.oliveira1676@etec.sp.gov.br> | 2025-04-01 17:30:52 +0000 |
| commit | a7a6e965979f7c46c2511a33cb601172573f3c84 (patch) | |
| tree | fafef5889ca77346cdcbd1c4a3db9cc34268c82f /app/confirmar/page.tsx | |
| parent | e99de28b064275cdd0b04b98c6c3f50e85c01d7c (diff) | |
| download | eleicoes-a7a6e965979f7c46c2511a33cb601172573f3c84.tar.gz eleicoes-a7a6e965979f7c46c2511a33cb601172573f3c84.zip | |
removed cpf
Diffstat (limited to 'app/confirmar/page.tsx')
| -rw-r--r-- | app/confirmar/page.tsx | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/app/confirmar/page.tsx b/app/confirmar/page.tsx index a8b6f1c..5ca80a1 100644 --- a/app/confirmar/page.tsx +++ b/app/confirmar/page.tsx @@ -18,50 +18,22 @@ export default function ConfirmPage() { const searchParams = useSearchParams(); const rm = searchParams.get("rm") || ""; const nome = searchParams.get("nome") || ""; - const cpf = searchParams.get("cpf") || ""; useEffect(() => { - if (!rm || !nome || !cpf) { + if (!rm || !nome) { router.push("/"); return; } - }, [rm, nome, cpf, router]); + }, [rm, nome, router]); const handleConfirm = () => { - router.push(`/votar?rm=${rm}&nome=${encodeURIComponent(nome)}&cpf=${cpf}`); + router.push(`/votar?rm=${rm}&nome=${encodeURIComponent(nome)}`); }; const handleCancel = () => { router.push("/"); }; - const formatCPFDisplay = (cpf: string) => { - if (cpf.includes(".") || cpf.includes("-")) return cpf; - - const cpfClean = cpf.replace(/\D/g, ""); - - if (cpfClean.length === 11) { - return `${cpfClean.substring(0, 3)}.${cpfClean.substring( - 3, - 6 - )}.${cpfClean.substring(6, 9)}-${cpfClean.substring(9, 11)}`; - } - - return cpf; - }; - - const maskCPF = (cpf: string) => { - const formatted = formatCPFDisplay(cpf); - const parts = formatted.split("."); - if (parts.length === 3) { - const lastPart = parts[2].split("-"); - if (lastPart.length === 2) { - return `${parts[0]}.${parts[1]}.${"***"}-${lastPart[1]}`; - } - } - return formatted; - }; - return ( <div className="flex min-h-screen flex-col items-center justify-center bg-[#f0f5fa] px-4 sm:px-6 lg:px-8"> <div className="w-full max-w-md sm:max-w-lg lg:max-w-xl"> @@ -99,13 +71,6 @@ export default function ConfirmPage() { <div className="text-xs sm:text-sm font-bold text-[#004a93]"> {nome} </div> - - <div className="text-xs sm:text-sm font-medium text-[#004a93]"> - CPF: - </div> - <div className="text-xs sm:text-sm font-bold text-[#004a93]"> - {maskCPF(cpf)} - </div> </div> </div> |