mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-05 23:19:37 +00:00
Redesigned network display cards and related components for a more modern, consistent look, including improved button styles, card layouts, and responsive design. Added support for background images and dynamic theming across cards, tables, and log views. Enhanced input and select components with unified styling. Improved file table responsiveness and log display usability. Refactored OneBot API debug and navigation UI for better usability and mobile support.
64 lines
1.4 KiB
TypeScript
64 lines
1.4 KiB
TypeScript
import { Button } from '@heroui/button';
|
|
import clsx from 'clsx';
|
|
import toast from 'react-hot-toast';
|
|
import { IoMdRefresh } from 'react-icons/io';
|
|
|
|
export interface SaveButtonsProps {
|
|
onSubmit: () => void;
|
|
reset: () => void;
|
|
refresh?: () => void;
|
|
isSubmitting: boolean;
|
|
className?: string;
|
|
}
|
|
|
|
const SaveButtons: React.FC<SaveButtonsProps> = ({
|
|
onSubmit,
|
|
reset,
|
|
isSubmitting,
|
|
refresh,
|
|
className,
|
|
}) => (
|
|
<div
|
|
className={clsx(
|
|
'w-full flex flex-col justify-center gap-3',
|
|
className
|
|
)}
|
|
>
|
|
<div className='flex items-center justify-center gap-2 mt-5'>
|
|
<Button
|
|
radius="full"
|
|
variant="flat"
|
|
className="font-medium bg-default-100 text-default-600 dark:bg-default-50/50"
|
|
onPress={() => {
|
|
reset();
|
|
toast.success('重置成功');
|
|
}}
|
|
>
|
|
取消更改
|
|
</Button>
|
|
<Button
|
|
color='primary'
|
|
radius="full"
|
|
className="font-medium shadow-md shadow-primary/20"
|
|
isLoading={isSubmitting}
|
|
onPress={() => onSubmit()}
|
|
>
|
|
保存
|
|
</Button>
|
|
{refresh && (
|
|
<Button
|
|
isIconOnly
|
|
radius='full'
|
|
variant='flat'
|
|
className="text-default-500 bg-default-100 dark:bg-default-50/50"
|
|
onPress={() => refresh()}
|
|
>
|
|
<IoMdRefresh size={20} />
|
|
</Button>
|
|
)}
|
|
</div>
|
|
</div>
|
|
);
|
|
|
|
export default SaveButtons;
|