mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-04 03:25:30 +08:00
### What problem does this PR solve? Feat: If a query variable in a data manipulation operator is deleted, a warning message should be displayed to the user. #10427 #11255 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
33 lines
708 B
TypeScript
33 lines
708 B
TypeScript
import { Button } from '@/components/ui/button';
|
|
import { FormLabel } from '@/components/ui/form';
|
|
import { Plus } from 'lucide-react';
|
|
import { ReactNode } from 'react';
|
|
|
|
export type FormListHeaderProps = {
|
|
label: ReactNode;
|
|
tooltip?: string;
|
|
onClick?: () => void;
|
|
disabled?: boolean;
|
|
};
|
|
|
|
export function DynamicFormHeader({
|
|
label,
|
|
tooltip,
|
|
onClick,
|
|
disabled = false,
|
|
}: FormListHeaderProps) {
|
|
return (
|
|
<div className="flex items-center justify-between">
|
|
<FormLabel tooltip={tooltip}>{label}</FormLabel>
|
|
<Button
|
|
variant={'ghost'}
|
|
type="button"
|
|
onClick={onClick}
|
|
disabled={disabled}
|
|
>
|
|
<Plus />
|
|
</Button>
|
|
</div>
|
|
);
|
|
}
|