fix(SW-3691): Setup one prettier config for whole repo * Setup prettierrc in root and remove other configs Approved-by: Joakim Jäderberg Approved-by: Linus Flood
26 lines
554 B
TypeScript
26 lines
554 B
TypeScript
"use client"
|
|
|
|
import { useController } from "react-hook-form"
|
|
|
|
import { Select } from "../../Select"
|
|
|
|
import { SelectProps } from "../../Select/types"
|
|
|
|
export function FormSelect({ label, items, name }: SelectProps) {
|
|
const { field, fieldState } = useController({
|
|
name,
|
|
})
|
|
return (
|
|
<Select
|
|
items={items}
|
|
label={label}
|
|
isInvalid={fieldState.invalid}
|
|
name={name}
|
|
onBlur={field.onBlur}
|
|
onSelectionChange={(c) => field.onChange(c ?? "")}
|
|
selectedKey={field.value}
|
|
data-testid={name}
|
|
/>
|
|
)
|
|
}
|