@gravity-ui/uikit
Version:
Gravity UI base styling and components
15 lines (14 loc) • 813 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { Button } from "../../../../index.js";
import { useFileZoneContext } from "../FileDropZone.Provider.js";
import { cnFileDropZone } from "../FileDropZone.classname.js";
import { FileDropZoneQa } from "../constants.js";
import i18n from "../i18n/index.js";
export const FileDropZoneButton = ({ className }) => {
const { buttonText, multiple } = useFileZoneContext();
const { t } = i18n.useTranslation();
const postfix = multiple ? 'multiple' : 'single';
const displayLabel = buttonText || t(`button_select-file-${postfix}`);
return (_jsx(Button, { component: "span", role: undefined, className: cnFileDropZone('button', className), qa: FileDropZoneQa.BUTTON, children: displayLabel }));
};
//# sourceMappingURL=FileDropZone.Button.js.map