import React, { HTMLAttributes, FunctionComponent, InputHTMLAttributes, useRef } from 'react'; import { getClassName } from '../../helpers/getClassName'; import Button, { VKUIButtonProps } from '../Button/Button'; import { classNames } from '../../lib/classNames'; import { HasRef, HasRootRef } from '../../types'; import { usePlatform } from '../../hooks/usePlatform'; import { setRef } from '../../lib/utils'; export interface FileProps extends Omit, Omit, 'onClick'>, Pick, 'onClick'>, HasRef, HasRootRef { controlSize?: VKUIButtonProps['size']; } const File: FunctionComponent = (props: FileProps) => { const { children, align, controlSize, mode, stretched, before, className, style, getRef, getRootRef, onClick, ...restProps } = props; const platform = usePlatform(); const inputRef = useRef(); const getInputRef = (element: HTMLInputElement) => { inputRef.current = element; setRef(element, getRef); }; return ( ); }; File.defaultProps = { children: 'Выберите файл', align: 'left', }; export default File;