import React from 'react'; import { FileUpload } from '@patternfly/react-core'; import FileUploadIcon from '@patternfly/react-icons/dist/esm/icons/file-upload-icon'; export const CustomPreviewFileUpload: React.FunctionComponent = () => { const [value, setValue] = React.useState(); const [filename, setFilename] = React.useState(''); const handleFileInputChange = (_, file: File) => { setValue(file); setFilename(file.name); }; const handleClear = (_event: React.MouseEvent) => { setFilename(''); setValue(undefined); }; return ( {value && (
Custom preview here for your {value.size}-byte file named{' '} {value.name}
)} ); };