mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-04 03:25:30 +08:00
fix: fix dataset-page's bugs (#8786)
### What problem does this PR solve? fix dataset-page's bugs,Input component supports icon, added Radio component, and removed antd from chunk-result-bar page [#3221 ](https://github.com/infiniflow/ragflow/issues/3221) ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -31,6 +31,15 @@ export function Segmented({
|
||||
onChange,
|
||||
className,
|
||||
}: SegmentedProps) {
|
||||
const [selectedValue, setSelectedValue] = React.useState<
|
||||
SegmentedValue | undefined
|
||||
>(value);
|
||||
const handleOnChange = (e: SegmentedValue) => {
|
||||
if (onChange) {
|
||||
onChange(e);
|
||||
}
|
||||
setSelectedValue(e);
|
||||
};
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
@ -48,11 +57,11 @@ export function Segmented({
|
||||
className={cn(
|
||||
'inline-flex items-center px-6 py-2 text-base font-normal rounded-3xl cursor-pointer text-text-badge',
|
||||
{
|
||||
'bg-text-title': value === actualValue,
|
||||
'text-text-title-invert': value === actualValue,
|
||||
'bg-text-title': selectedValue === actualValue,
|
||||
'text-text-title-invert': selectedValue === actualValue,
|
||||
},
|
||||
)}
|
||||
onClick={() => onChange?.(actualValue)}
|
||||
onClick={() => handleOnChange(actualValue)}
|
||||
>
|
||||
{isObject ? option.label : option}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user