mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-19 05:59:34 +02:00
fix: misc
This commit is contained in:
@@ -14,6 +14,7 @@ interface MultiPdfInputComponentProps {
|
||||
value: MultiPdfInput[];
|
||||
onChange: (file: MultiPdfInput[]) => void;
|
||||
}
|
||||
|
||||
export interface MultiPdfInput {
|
||||
file: File;
|
||||
order: number;
|
||||
@@ -43,20 +44,6 @@ export default function ToolMultiFileInput({
|
||||
fileInputRef.current?.click();
|
||||
};
|
||||
|
||||
const handleCopy = () => {
|
||||
if (isArray(value)) {
|
||||
const blob = new Blob([value[0].file], { type: value[0].file.type });
|
||||
const clipboardItem = new ClipboardItem({ [value[0].file.type]: blob });
|
||||
|
||||
navigator.clipboard
|
||||
.write([clipboardItem])
|
||||
.then(() => showSnackBar('File copied', 'success'))
|
||||
.catch((err) => {
|
||||
showSnackBar('Failed to copy: ' + err, 'error');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function handleClear() {
|
||||
onChange([]);
|
||||
}
|
||||
@@ -175,11 +162,7 @@ export default function ToolMultiFileInput({
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
<InputFooter
|
||||
handleCopy={handleCopy}
|
||||
handleImport={handleImportClick}
|
||||
handleClear={handleClear}
|
||||
/>
|
||||
<InputFooter handleImport={handleImportClick} handleClear={handleClear} />
|
||||
<input
|
||||
ref={fileInputRef}
|
||||
style={{ display: 'none' }}
|
||||
|
@@ -173,7 +173,9 @@ export default function ToolFileResult({
|
||||
disabled={!value}
|
||||
handleCopy={handleCopy}
|
||||
handleDownload={handleDownload}
|
||||
hideCopy={fileType === 'video' || fileType === 'audio'}
|
||||
hideCopy={
|
||||
fileType === 'video' || fileType === 'audio' || fileType === 'pdf'
|
||||
}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
|
Reference in New Issue
Block a user