"use client" import { useState } from "react" import { Button, type Key, ListBox, ListBoxItem, Popover, Select as ReactAriaSelect, SelectValue, } from "react-aria-components" import Label from "@/components/TempDesignSystem/Form/Label" import Body from "@/components/TempDesignSystem/Text/Body" import SelectChevron from "../Form/SelectChevron" import styles from "./select.module.css" import type { SelectPortalContainer, SelectPortalContainerArgs, SelectProps, } from "./select" export default function Select({ "aria-label": ariaLabel, defaultSelectedKey, items, label, name, onSelect, placeholder, required = false, tabIndex, value, }: SelectProps) { const [rootDiv, setRootDiv] = useState(undefined) function setRef(node: SelectPortalContainerArgs) { if (node) { setRootDiv(node) } } function handleOnSelect(key: Key) { onSelect(key) } return (
{items.map((item) => ( {item.label} ))}
) }