/** * Copyright (c) Paymium. * * This source code is licensed under the MIT license found in the * LICENSE file in the root of this projects source tree. */ import { ComponentType, forwardRef } from 'react'; import { useContext } from './context'; import { composeEventHandlers } from '@crossed/core'; import { RovingFocus } from '../utils/RovingFocus'; export type SelectItemProps = { disabled?: boolean; value?: string; }; export const createSelectItem =

>( Styled: ComponentType

) => // eslint-disable-next-line @typescript-eslint/ban-ts-comment //@ts-ignore forwardRef(({ value, ...props }, ref) => { const { setOpen, setValue } = useContext(); return ( { setOpen(false); setValue(value); })} /> ); });