omni-tools/src/components/result/ResultFooter.tsx

39 lines
875 B
TypeScript
Raw Normal View History

2024-06-25 01:10:41 +01:00
import { Stack } from '@mui/material';
import Button from '@mui/material/Button';
import DownloadIcon from '@mui/icons-material/Download';
import ContentPasteIcon from '@mui/icons-material/ContentPaste';
import React from 'react';
export default function ResultFooter({
handleDownload,
handleCopy,
2025-04-03 20:04:25 +00:00
disabled,
hideCopy
2024-06-25 01:10:41 +01:00
}: {
handleDownload: () => void;
handleCopy: () => void;
disabled?: boolean;
2025-04-03 20:04:25 +00:00
hideCopy?: boolean;
2024-06-25 01:10:41 +01:00
}) {
return (
<Stack mt={1} direction={'row'} spacing={2}>
<Button
disabled={disabled}
onClick={handleDownload}
startIcon={<DownloadIcon />}
>
Save as
</Button>
2025-04-03 20:04:25 +00:00
{!hideCopy && (
<Button
disabled={disabled}
onClick={handleCopy}
startIcon={<ContentPasteIcon />}
>
Copy to clipboard
</Button>
)}
2024-06-25 01:10:41 +01:00
</Stack>
);
}