dify/web/app/components/base/radio/component/group/index.tsx
Junjie.M aeceb200ec
Some checks are pending
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Waiting to run
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Blocked by required conditions
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Blocked by required conditions
fix: llm parameters radio type dark style (#19833)
2025-05-16 20:45:15 +08:00

25 lines
777 B
TypeScript

import type { ReactNode } from 'react'
import RadioGroupContext from '../../context'
import s from '../../style.module.css'
import cn from '@/utils/classnames'
export type TRadioGroupProps = {
children?: ReactNode | ReactNode[]
value?: string | number
className?: string
onChange?: (value: any) => void
}
export default function Group({ children, value, onChange, className = '' }: TRadioGroupProps): React.JSX.Element {
const onRadioChange = (value: any) => {
onChange?.(value)
}
return (
<div className={cn('flex items-center bg-workflow-block-parma-bg text-text-secondary', s.container, className)}>
<RadioGroupContext.Provider value={{ value, onChange: onRadioChange }}>
{children}
</RadioGroupContext.Provider>
</div>
)
}