chore: hideCopy if video or audio

This commit is contained in:
Ibrahima G. Coulibaly
2025-04-03 20:04:25 +00:00
parent 3b37b67474
commit 1c22bf4c5b
3 changed files with 14 additions and 9 deletions

View File

@@ -7,11 +7,13 @@ import React from 'react';
export default function ResultFooter({ export default function ResultFooter({
handleDownload, handleDownload,
handleCopy, handleCopy,
disabled disabled,
hideCopy
}: { }: {
handleDownload: () => void; handleDownload: () => void;
handleCopy: () => void; handleCopy: () => void;
disabled?: boolean; disabled?: boolean;
hideCopy?: boolean;
}) { }) {
return ( return (
<Stack mt={1} direction={'row'} spacing={2}> <Stack mt={1} direction={'row'} spacing={2}>
@@ -22,6 +24,7 @@ export default function ResultFooter({
> >
Save as Save as
</Button> </Button>
{!hideCopy && (
<Button <Button
disabled={disabled} disabled={disabled}
onClick={handleCopy} onClick={handleCopy}
@@ -29,6 +32,7 @@ export default function ResultFooter({
> >
Copy to clipboard Copy to clipboard
</Button> </Button>
)}
</Stack> </Stack>
); );
} }

View File

@@ -173,6 +173,7 @@ export default function ToolFileResult({
disabled={!value} disabled={!value}
handleCopy={handleCopy} handleCopy={handleCopy}
handleDownload={handleDownload} handleDownload={handleDownload}
hideCopy={fileType === 'video' || fileType === 'audio'}
/> />
</Box> </Box>
); );

View File

@@ -17,9 +17,9 @@ const toolCategoriesOrder: ToolCategory[] = [
'string', 'string',
'json', 'json',
'pdf', 'pdf',
'video',
'list', 'list',
'csv', 'csv',
'video',
'number', 'number',
'png', 'png',
'time', 'time',