UNPKG

payload-kanban-board

Version:
44 lines (43 loc) 1.79 kB
'use client'; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { ChevronIcon } from '@payloadcms/ui/icons/Chevron'; import { useState } from 'react'; import BoardCardList from './../BoardCardList/BoardCardList.js'; import './styles.scss'; const baseClass = 'board-column'; const BoardColumn = (props)=>{ const { title, identifier, contents, collection, collapsible, dragEnabled } = props; const [isCollapsed, setCollapsed] = useState(!!collapsible); return /*#__PURE__*/ _jsxs("div", { className: `${baseClass}__wrapper ${isCollapsed ? `${baseClass}__collapsed` : ''}`, children: [ /*#__PURE__*/ _jsxs("div", { className: `${baseClass}__header ${isCollapsed ? `${baseClass}__header_collapsed` : ''}`, children: [ /*#__PURE__*/ _jsxs("h4", { children: [ title, " ", /*#__PURE__*/ _jsx("span", { children: contents?.length }) ] }), collapsible && /*#__PURE__*/ _jsx("div", { onClick: ()=>setCollapsed(!isCollapsed), className: `${baseClass}__collapse`, children: /*#__PURE__*/ _jsx(ChevronIcon, {}) }) ] }), !isCollapsed && /*#__PURE__*/ _jsx(BoardCardList, { listId: identifier, contents: contents, collection: collection, dragEnabled: dragEnabled }) ] }); }; export default BoardColumn; //# sourceMappingURL=BoardColumn.js.map