mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-31 01:01: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:
@ -5,7 +5,27 @@ import * as React from 'react';
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
const Popover = PopoverPrimitive.Root;
|
||||
const Popover = (props: PopoverPrimitive.PopoverProps) => {
|
||||
const { children, open: openState, onOpenChange } = props;
|
||||
const [open, setOpen] = React.useState(true);
|
||||
React.useEffect(() => {
|
||||
setOpen(!!openState);
|
||||
}, [openState]);
|
||||
const handleOnOpenChange = React.useCallback(
|
||||
(e: boolean) => {
|
||||
if (onOpenChange) {
|
||||
onOpenChange?.(e);
|
||||
}
|
||||
setOpen(e);
|
||||
},
|
||||
[onOpenChange],
|
||||
);
|
||||
return (
|
||||
<PopoverPrimitive.Root open={open} onOpenChange={handleOnOpenChange}>
|
||||
{children}
|
||||
</PopoverPrimitive.Root>
|
||||
);
|
||||
};
|
||||
|
||||
const PopoverTrigger = PopoverPrimitive.Trigger;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user