Files
games-frontend-js/src/components/formFields/SelectInput.tsx
T
john-okeefe 7bdf42ac07 refactor(forms): port game form to Chakra v3 with v4-style selects
- New FixedSelect wrapper over chakra-react-select v6 restoring the v4
  look everywhere: single gray.500 control border, flush addon chevron
  zone with rounded inner corners, hidden indicator separator, v4 option
  padding/type scale, gray subtle pills, brighter unselected hover
- GameForm: FormControl/InputGroup -> Field/Flex, Button
  colorScheme/isLoading -> colorPalette/loading, Stack spacing -> gap,
  Container container.md -> 768px, Steam Scrape row rebuilt as nowrap
  Flex, select wrappers de-bordered (control owns the border)
- formFields: Field/Checkbox/Switch shims in, required asterisk dropped
  to match legacy labels, Select/Creatable wrappers de-bordered,
  TS-typed select callbacks
2026-09-06 10:29:41 -04:00

41 lines
1.1 KiB
TypeScript

import React from 'react'
import {Box} from '@chakra-ui/react'
import { Field } from '../ui/field'
import {Select} from '../FixedSelect'
interface Props {
label: string
textField: string
field: string
bg: string
handleAccessedBy: any
options: { value: string, label: string }[]
width?: string
}
const SelectInput = ({label, textField, field, bg, handleAccessedBy, options, width = ''}: Props) => {
return (
<Field mb="3" label={label}>
<Box
bg={bg}
w={width || 'full'}
rounded="md">
<Select
id={textField}
name={textField}
onChange={(values: any) => {
if (values) handleAccessedBy(textField, values.value)
}}
options={options}
value={{
value: field,
label: field,
}}
/>
</Box>
</Field>
)
}
export default SelectInput