mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-21 15:09:32 +02:00
feat: split pdf
This commit is contained in:
23
src/components/input/ToolPdfInput.tsx
Normal file
23
src/components/input/ToolPdfInput.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import React, { useRef } from 'react';
|
||||
import BaseFileInput from './BaseFileInput';
|
||||
import { BaseFileInputProps } from './file-input-utils';
|
||||
|
||||
interface PdfFileInputProps extends BaseFileInputProps {}
|
||||
|
||||
export default function ToolPdfInput({ ...props }: PdfFileInputProps) {
|
||||
const pdfRef = useRef<HTMLIFrameElement>(null);
|
||||
|
||||
return (
|
||||
<BaseFileInput {...props} type={'pdf'}>
|
||||
{({ preview }) => (
|
||||
<iframe
|
||||
ref={pdfRef}
|
||||
src={preview}
|
||||
width="100%"
|
||||
height="100%"
|
||||
style={{ maxWidth: '500px' }}
|
||||
/>
|
||||
)}
|
||||
</BaseFileInput>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user