"use client" import { useEffect, useRef, useState, type FocusEvent } from "react" import { Button, Label, ListBox, ListBoxItem, Popover, Select as ReactAriaSelect, SelectValue, type Key, } from "react-aria-components" import SelectChevron from "../../SelectChevron" import styles from "./select.module.css" import type { SelectProps } from "./select" export default function Select({ "aria-label": ariaLabel, items, label, name, onSelect, placeholder, value, }: SelectProps) { const divRef = useRef(null) const [divElement, setDivElement] = useState(divRef.current) function handleOnSelect(key: Key) { onSelect(key, name) } useEffect(() => { if (divRef.current) { setDivElement(divRef.current) } }, [divRef.current]) return (
{items.map((item) => ( {item} ))}
) }