import type { ReactElement } from "react"; import { useContext } from "react"; import { Locale } from "../../locale"; import { FilesUploaderCtx } from "../context/index"; /** * Компонент вывода подсказки загрузчика * @returns * */ export const FilesUploaderTip = (): ReactElement => { const { getCN, fileTypes, maxSize, isMultiple, maxFiles, maxSizeType, } = useContext(FilesUploaderCtx); const types = fileTypes.length === 0 ? "*" : fileTypes.map((type) => type.toUpperCase()).join(", "); const isMaxSize = typeof maxSize === "number" && maxSize > 0 && maxSize !== Infinity; return (
{isMaxSize &&
}
); };