/** ========================================================= * Material Dashboard 2 PRO React TS - v1.0.0 ========================================================= * Product Page: https://www.creative-tim.com/product/material-dashboard-2-pro-react-ts * Copyright 2022 Creative Tim (https://www.creative-tim.com) Coded by www.creative-tim.com ========================================================= * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. */ import { useState } from "react"; // @asseinfo/react-kanban components import Board from "@asseinfo/react-kanban"; // html-react-parser import parse from "html-react-parser"; // uuid is a library for generating unique id import { v4 as uuidv4 } from "uuid"; // @mui material components import Icon from "@mui/material/Icon"; import { Theme } from "@mui/material/styles"; // Material Dashboard 2 PRO React TS components import MDBox from "components/MDBox"; import MDButton from "components/MDButton"; import MDTypography from "components/MDTypography"; import MDInput from "components/MDInput"; // Material Dashboard 2 PRO React TS examples components import DashboardLayout from "examples/LayoutContainers/DashboardLayout"; import DashboardNavbar from "examples/Navbars/DashboardNavbar"; import Footer from "examples/Footer"; // Kanban application components import Header from "layouts/applications/kanban/components/Header"; // Data import boards from "layouts/applications/kanban/data"; // Material Dashboard 2 PRO React context import { useMaterialUIController } from "context"; function Kanban(): JSX.Element { const [controller] = useMaterialUIController(); const { darkMode } = controller; const [newCardForm, setNewCardForm] = useState(false); const [formValue, setFormValue] = useState(""); const openNewCardForm = (event: HTMLButtonElement | any, id: string | number) => setNewCardForm(id); const closeNewCardForm = () => setNewCardForm(false); const handeSetFormValue = ({ currentTarget }: any) => setFormValue(currentTarget.value); return (
({ "& .react-kanban-column": { backgroundColor: darkMode ? background.card : light.main, width: pxToRem(450), margin: `0 ${pxToRem(10)}`, padding: pxToRem(20), borderRadius: borderRadius.lg, }, })} > ( <> {title} openNewCardForm(event, id)}> dark.main, }} > add {newCardForm === id ? ( { addCard({ id: uuidv4(), template: formValue }); setFormValue(""); }} > add cancel ) : null} )} renderCard={({ id, template }: any, { dragging }: any) => ( darkMode ? `${borderWidth[1]} solid ${white.main}` : 0, fontSize: ({ typography: { size } }: any) => size.md, }} > {typeof template === "string" ? parse(template) : template} )} onCardNew={(): any => null} />