'use client' import { Select, SelectItem } from '@nextui-org/react' import { useEffect, useState } from 'react' import { useAxios } from '@/hooks/useAxios' export default function RoofSelect() { const [roofMaterials, setRoofMaterials] = useState([]) const [trestles, setTrestles] = useState([]) const { get } = useAxios() const handleRoofMaterialOnChange = (e) => { const id = e.target.value setTrestles([]) get({ url: `/api/trestle/v1.0/trestles/${id}` }).then((res) => { setTrestles(res) }) } useEffect(() => { get({ url: '/api/roof-material/v1.0/roof-materials' }).then((res) => { setRoofMaterials(res) }) }, []) return ( <>