Feature: Added data source functionality #10703 (#11046)

### What problem does this PR solve?

Feature: Added data source functionality

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
chanx
2025-11-06 11:53:46 +08:00
committed by GitHub
parent 15c75bbf15
commit f581a1c4e5
31 changed files with 2526 additions and 16 deletions

View File

@ -0,0 +1,41 @@
import { cn } from '@/lib/utils';
import { ArrowBigLeft } from 'lucide-react';
import React from 'react';
import { useNavigate } from 'umi';
import { Button } from '../ui/button';
interface BackButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
to?: string;
}
const BackButton: React.FC<BackButtonProps> = ({
to,
className,
children,
...props
}) => {
const navigate = useNavigate();
const handleClick = () => {
if (to) {
navigate(to);
} else {
navigate(-1);
}
};
return (
<Button
variant="ghost"
className={cn('gap-2 bg-bg-card border border-border-default', className)}
onClick={handleClick}
{...props}
>
<ArrowBigLeft className="h-4 w-4" />
{children || 'Back'}
</Button>
);
};
export default BackButton;