mirror of
https://github.com/langgenius/dify.git
synced 2026-02-12 22:14:59 +08:00
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
25 lines
777 B
TypeScript
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>
|
|
)
|
|
}
|