UNPKG

vfi-2fa

Version:

- Headless (100% customizable, Bring-your-own-UI) - Auto out of the box, fully controllable API - Sorting (Multi and Stable) - Filters - Row Selection - Row Expansion - Column Ordering - Animatable - Resizable - Server-side/controlled data/state

33 lines (32 loc) 1.91 kB
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { Copy, Edit, Info, Plus, X } from "becoxy-icons"; import classNames from "classnames"; const ModalHeader = (props) => { // ** Props const { title, handleModal, typeModal = 'Edit', component, style } = props; const handleModalIcon = () => { if (typeModal === 'Edit' || typeModal === 'Approval') { return _jsx(Edit, { fontSize: 17, className: 'me-1' }); } else if (typeModal === 'View') { return _jsx(Info, { fontSize: 17, className: 'me-1' }); } else if (typeModal === 'Detail') { return _jsx(Info, { fontSize: 17, className: 'me-1' }); } else if (typeModal === 'Copy') { return _jsx(Copy, { fontSize: 17, className: 'me-1' }); } else if (typeModal === 'Order') { return _jsx("span", { className: "e-icons e-sorting-1 me-1", style: { fontSize: '14px' } }); } else if (typeModal === 'Process') { return _jsx("span", { className: "e-flat e-icons e-paste-match-destination me-1", style: { fontSize: '14px' } }); } else { return _jsx(Plus, { fontSize: 17, className: 'me-1' }); } }; return (_jsxs("div", { className: 'modal-header d-flex align-items-center justify-content-between mb-1', style: { ...style }, children: [_jsxs("div", { className: "d-flex align-items-center justify-content-start", children: [_jsxs("h5", { className: 'modal-title', children: [handleModalIcon(), " ", title] }), component ? component() : _jsx(_Fragment, {})] }), _jsx("div", { className: 'todo-item-action d-flex align-items-center', children: _jsx(X, { className: classNames('fw-normal mt-25 cursor-pointer', { 'd-none': !handleModal }), fontSize: 20, onClick: handleModal }) })] })); }; export default ModalHeader;