Expanded ChoicesToggleGroup for string choices
This commit is contained in:
parent
e76e5b62cb
commit
9edc389719
|
@ -2,9 +2,9 @@ import { Row } from './layout/row'
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
|
|
||||||
export function ChoicesToggleGroup(props: {
|
export function ChoicesToggleGroup(props: {
|
||||||
currentChoice: number
|
currentChoice: number | string
|
||||||
setChoice: (p: number) => void
|
setChoice: (p: any) => void //number | string does not work here because of SetStateAction in .tsx
|
||||||
choices: number[]
|
choices: number[] | string[]
|
||||||
titles: string[]
|
titles: string[]
|
||||||
isSubmitting?: boolean
|
isSubmitting?: boolean
|
||||||
}) {
|
}) {
|
||||||
|
@ -18,7 +18,7 @@ export function ChoicesToggleGroup(props: {
|
||||||
{choices.map((choice, i) => {
|
{choices.map((choice, i) => {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
key={choice + i + ''}
|
key={choice.toString()}
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
baseButtonClassName,
|
baseButtonClassName,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user