diff --git a/src/app/solicitar-ayuda/_components/Form/FormContainer.tsx b/src/app/solicitar-ayuda/_components/Form/FormContainer.tsx index db0146b0..10941cc5 100644 --- a/src/app/solicitar-ayuda/_components/Form/FormContainer.tsx +++ b/src/app/solicitar-ayuda/_components/Form/FormContainer.tsx @@ -4,7 +4,6 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { FormRenderer } from './FormRenderer'; import { FormData, Status } from '../types'; -// @ts-expect-error import { formatPhoneNumber, isValidPhone } from '@/helpers/utils'; import { helpRequestService } from '@/lib/service'; import { Database } from '@/types/database'; diff --git a/src/app/solicitar-ayuda/_components/Form/FormRenderer.tsx b/src/app/solicitar-ayuda/_components/Form/FormRenderer.tsx index bfa76110..6d6ae239 100644 --- a/src/app/solicitar-ayuda/_components/Form/FormRenderer.tsx +++ b/src/app/solicitar-ayuda/_components/Form/FormRenderer.tsx @@ -3,11 +3,10 @@ import React from 'react'; import { Check } from 'lucide-react'; import { PhoneInput } from '@/components/PhoneInput'; -// @ts-expect-error -import AddressAutocomplete from '@/components/AddressAutocomplete'; +import AddressAutocomplete from '@/components/AddressAutocomplete.js'; import { TIPOS_DE_AYUDA } from '../constants'; import { TipoDeAyudaInputRenderer } from '../TipoDeAyudaInputRenderer'; -import { FormData, HelpCategory, Status, Town } from '../types'; +import { FormData, HelpCategory, Status } from '../types'; import { TownSelector } from '../TownSelector'; type FormRendererProps = { diff --git a/src/components/PhoneInput/PhoneInputContainer.tsx b/src/components/PhoneInput/PhoneInputContainer.tsx index 61b69c93..92904220 100644 --- a/src/components/PhoneInput/PhoneInputContainer.tsx +++ b/src/components/PhoneInput/PhoneInputContainer.tsx @@ -4,7 +4,6 @@ import React, { useCallback, useState } from 'react'; import { PhoneInputRenderer } from './PhoneInputRenderer'; import { PhoneInputProps } from './types'; -// @ts-expect-error import { isValidPhone } from '@/helpers/utils'; export function PhoneInputContainer({ onChange, phoneNumber, required = false }: PhoneInputProps) { diff --git a/src/helpers/utils.js b/src/helpers/utils.ts similarity index 73% rename from src/helpers/utils.js rename to src/helpers/utils.ts index 4f9aa3b9..d1710cbd 100644 --- a/src/helpers/utils.js +++ b/src/helpers/utils.ts @@ -1,10 +1,10 @@ import { callCenterPhoneTrimmed } from '@/constants/phoneNumber'; -const isPhoneEqualToCallCenter = (phoneNumber) => { +const isPhoneEqualToCallCenter = (phoneNumber: string) => { return phoneNumber === callCenterPhoneTrimmed; }; -export const isValidPhone = (phoneNumber) => { +export const isValidPhone = (phoneNumber: string) => { const phoneNumberWithoutSpaces = phoneNumber.replace(/\D/g, ''); return ( @@ -14,7 +14,7 @@ export const isValidPhone = (phoneNumber) => { ); }; -export const formatPhoneNumber = (value) => { +export const formatPhoneNumber = (value: string) => { // Remove white spaces and non-digit characters return value.replace(/\s/g, '').replace(/\D/g, ''); };