phx-react
Version:
PHX REACT
13 lines • 1.18 kB
JavaScript
import React from 'react';
import { PHXButton } from '../Button';
export function ButtonUpload(_a) {
var fileType = _a.fileType, handleUploadClick = _a.handleUploadClick, helpText = _a.helpText, _b = _a.loading, loading = _b === void 0 ? false : _b;
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, { loading: loading, onClick: handleUploadClick, secondary: true, size: 'micro' }, "T\u1EA3i l\u00EAn"))),
helpText ? (React.createElement("p", { className: 'cursor-pointer text-xs leading-6 text-gray-400' }, helpText)) : (React.createElement("p", { className: 'cursor-pointer text-xs leading-6 text-gray-400' }, (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