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.85 kB
import{jsx as r,jsxs as i,Fragment as e}from"react/jsx-runtime";import a from"@mui/material/Typography";import t from"@mui/material/Card";import o from"@mui/material/CardActionArea";import n from"@mui/material/List";import m from"@mui/material/ListItem";import d from"@mui/material/ListItemText";import l from"@mui/material/Box";import s from"@mui/icons-material/Add";import c from"./EmptyCard.styles.js";import{useCardLoading as p}from"../Card/hooks/useCardLoading.js";import{LoadingManager as y}from"../Card/components/LoadingManager.js";import{EmptyCardSkeleton as g,EmptyCardRectangleSkeleton as h}from"./EmptyCard.skeleton.js";import{EmptyState as u}from"../EmptyState/EmptyState.container.js";const f=({header:f="",description:x="",icon:C=r(s,{className:"iconStyle"}),mode:A="square",loading:v,loadingMode:L="spinner",sx:j,...M})=>{const S="string"==typeof f?r(a,{component:"div",variant:"subtitle1",color:"primary",children:f}):f,k="string"==typeof x?r(a,{component:"div",variant:"caption",color:"text.secondary",children:x}):x,{renderLoadingPanel:q,cardLoadingStyle:E}=p(v,L);return i(e,{children:["square"===A&&r(t,{"data-testid":"squareCard",elevation:0,variant:"outlined",...M,sx:[c.squareCard,E,...Array.isArray(j)?j:[j]],children:i(y,{loading:v,loadingMode:L,skeleton:g,children:[r(o,{sx:{height:1,p:4},children:r(l,{sx:{color:"primary.main"},children:r(u,{icon:C,header:f,description:k})})}),q]})}),"rectangle"===A&&r(t,{"data-testid":"rectangleCard",elevation:0,variant:"outlined",...M,sx:[c.rectangleCard,E,...Array.isArray(j)?j:[j]],children:i(y,{loading:v,loadingMode:L,skeleton:"rectangle"===A?h:g,children:[r(o,{sx:{height:1},children:r(n,{disablePadding:!0,children:r(m,{secondaryAction:C,sx:{"& .MuiListItemSecondaryAction-root":{color:"primary.main"}},children:r(d,{primary:S,secondary:k})})})}),q]})})]})};export{f as default};