import { forwardRef, useRef } from 'react'; import { Icon } from '../icon'; import { InputFileStyles as S } from './input-file.styles'; type InputFileProps = { value: string; onChange: (e: React.ChangeEvent) => void; } & React.ComponentProps; export const StyledInputFile = forwardRef( ({ value: file, onChange, css, ...props }, ref) => { const inputFileRef = useRef(null); const handleFileChange = (e: React.ChangeEvent) => { e.preventDefault(); onChange(e); }; const handleInputClick = () => { inputFileRef.current?.click(); }; return ( <> {file !== '' ? ( logo ) : ( )} ); } );