Files
ragflow/web/src/pages/dataset/setting/chunk-method-learn-more.tsx
balibabu 4110f7f5ce Fix: The buttons at the bottom of the dataset settings page are not visible on small screens #9638 (#9639)
### What problem does this PR solve?

Fix: The buttons at the bottom of the dataset settings page are not
visible on small screens #9638
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
2025-08-21 19:25:14 +08:00

49 lines
1.1 KiB
TypeScript

import { Button } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import { X } from 'lucide-react';
import { useState } from 'react';
import CategoryPanel from './category-panel';
export default ({
tab = 'generalForm',
parserId,
}: {
tab: 'generalForm' | 'chunkMethodForm';
parserId: string;
}) => {
const [visible, setVisible] = useState(false);
return (
<div
className={cn('hidden flex-1', {
'flex flex-col': tab === 'chunkMethodForm',
})}
>
<div>
<Button
variant="outline"
onClick={() => {
setVisible(!visible);
}}
>
Learn More
</Button>
</div>
<div
className="bg-[#FFF]/10 p-[20px] rounded-[12px] mt-[10px] relative flex-1 overflow-auto"
style={{ display: visible ? 'block' : 'none' }}
>
<CategoryPanel chunkMethod={parserId}></CategoryPanel>
<div
className="absolute right-1 top-1 cursor-pointer hover:text-[#FFF]/30"
onClick={() => {
setVisible(false);
}}
>
<X />
</div>
</div>
</div>
);
};