import React from "react"; import classNames from "classnames"; import { useConfig } from "../../_util/config-context"; import { Input } from "../../input"; import { StyledProps } from "../../_type"; export interface FileProps extends StyledProps { /** * 文件名 */ filename?: string; /** * 上传进度 */ percent?: number; /** * 按钮区域内容 */ button?: React.ReactNode; } export const File = React.forwardRef(function File( { filename, percent, button, className, ...props }: FileProps, ref: React.Ref ) { const { classPrefix } = useConfig(); return (
{(percent || percent === 0) && ( {Math.floor(percent)}% )}
{button}
); }); File.displayName = "UploadFile";