UNPKG

phx-react

Version:

PHX REACT

13 lines 1.32 kB
import React from 'react'; import { PHXButton } from '../Button'; import { classNames } from '../types'; export function ButtonUpload({ fileType, handleUploadClick, helpText, loading = false, disabled = false, }) { return (React.createElement(React.Fragment, null, React.createElement("div", { className: 'mt-2 flex text-sm leading-6 text-gray-600' }, React.createElement("label", { className: 'relative cursor-pointer rounded-md bg-white font-semibold text-indigo-600 hover:text-indigo-500', htmlFor: 'file-upload' }, React.createElement(PHXButton, { className: classNames(disabled ? 'cursor-not-allowed' : ''), disabled: disabled, loading: loading, onClick: handleUploadClick, secondary: true, size: 'micro' }, "T\u1EA3i l\u00EAn"))), helpText ? (React.createElement("p", { className: classNames('cursor-pointer text-xs leading-6 text-gray-500', disabled ? 'cursor-not-allowed' : '') }, helpText)) : (React.createElement("p", { className: classNames('text-xs leading-6 text-gray-400', disabled ? 'cursor-not-allowed' : 'cursor-pointer ') }, (fileType === 'excel' && 'XLXS, XLS tối đa 100MB') || (fileType === 'image' && 'JPG, JPEG, PNG, GIF, WEBP') || (fileType === 'file' && 'PDF, JPG, JPEG, PNG'))))); } //# sourceMappingURL=ButtonUpload.js.map