"use client"; import axios from "axios"; import { useEffect, useState } from "react"; import { envConfig } from "../lib/config"; if (!envConfig.apiUrl) { console.error("API URL is not defined in envConfig"); } interface proms { url: string; } export default function SelectAreas(props: proms) { const [areas, setAreas] = useState([]); const [selectedArea, setSelectedArea] = useState(""); useEffect(() => { axios .get(`${envConfig.apiUrl}/area-ubicacion`) .then((data) => { setAreas(data.data); }) .catch((error) => { console.error("Error al traer las áreas:", error); }); }, []); return (