UNPKG

@nexusui/components

Version:

These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.

2 lines (1 loc) 1.45 kB
import*as t from"react";import{createElement as r}from"react";import{jsxs as e,jsx as a}from"react/jsx-runtime";import i from"@mui/material/Card";import o from"@mui/material/CardContent";import s from"@mui/material/CardHeader";import d from"@mui/material/Typography";import m from"@mui/material/CardActions";import n from"@mui/material/List";import{TaskItem as l}from"./TaskItem/TaskItem.component.js";const c="NexusTaskManager",p=p=>{const{title:h,tasks:u,endGoal:f,...g}=p;return e(i,{variant:"outlined","data-testid":`${c}-root`,className:`${c}-root`,...g,children:[h&&a(s,{"data-testid":`${c}-header`,className:`${c}-header`,sx:{height:40,borderBottom:"1px solid",borderBottomColor:"divider"},disableTypography:!0,title:"string"==typeof h?a(d,{fontWeight:700,"data-testid":`${c}-title`,className:`${c}-title`,children:"Tasks"}):h}),a(o,{"data-testid":`${c}-content`,className:`${c}-content`,children:a(n,{disablePadding:!0,children:u.map((a=>{const{subtasks:i=[],id:o,...s}=a;return e(t.Fragment,{children:[r(l,{...s,key:o,nesting:"none"}),i.map(((t,e)=>{const{id:a,...o}=t;return r(l,{...o,key:a,nesting:e===i.length-1?"last-child":"nth-child"})}))]},o)}))})}),f&&a(m,{"data-testid":`${c}-endGoal`,className:`${c}-endGoal`,sx:{borderTop:"1px solid",borderTopColor:"divider",p:0},children:a(n,{disablePadding:!0,sx:{width:"100%"},children:a(l,{...f,sx:[{border:"none"},...Array.isArray(f.sx)?f.sx:[f.sx]]})})})]})};export{p as TaskManager};