Skip to main content
Glama
deleonio
by deleonio
SelectStateWrapper.tsx1.19 kB
import { h, type FunctionalComponent as FC } from '@stencil/core'; import KolSelectFc, { type SelectProps } from '../../functional-components/inputs/NativeSelect'; import { type MsgPropType, type SelectStates } from '../../schema'; import { getRenderStates } from '../_helpers/getRenderStates'; export type SelectStateWrapperProps = Partial<SelectProps> & { state: SelectStates; }; function getSelectProps(state: SelectStates): SelectProps { const { ariaDescribedBy } = getRenderStates(state); const props: SelectProps = { id: state._id, hideLabel: state._hideLabel, label: state._label, value: state._value, options: state._options, accessKey: state._accessKey, disabled: state._disabled, name: state._name, ariaDescribedBy: ariaDescribedBy, size: state._rows, multiple: state._multiple, required: state._required, touched: state._touched, msg: state._msg as MsgPropType, }; if ('_shortKey' in state) props['aria-keyshortcuts'] = state._shortKey; return props; } const SelectStateWrapper: FC<SelectStateWrapperProps> = ({ state, ...other }) => { return <KolSelectFc {...getSelectProps(state)} {...other} />; }; export default SelectStateWrapper;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/deleonio/public-ui-kolibri'

If you have feedback or need assistance with the MCP directory API, please join our Discord server