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.

3 lines (2 loc) 1.05 kB
"use client"; import{jsx as r}from"react/jsx-runtime";import t from"react";import o from"@mui/material/Box";import e from"@mui/material/Stack";import i from"@mui/material/Typography";import{EmptyStateComponent as m}from"./EmptyState.component.js";import{prefix as n}from"./constant.js";const a=a=>{const{size:s="medium",icon:p,header:c,description:d,actions:l,...x}=a,y=p,h=r(o,{sx:{mt:p?4:0},children:"string"==typeof c?r(i,{variant:"small"===s?"subtitle1":"h6","data-testid":`${n}-header`,className:`${n}-header`,children:c}):c}),f=d&&r(o,{sx:{mt:2},children:"string"==typeof d?r(i,{variant:"small"===s?"body2":"body1",color:"text.secondary","data-testid":`${n}-description`,className:`${n}-description`,children:d}):d}),u=Array.isArray(l)&&r(e,{sx:{mt:6},direction:{xs:"column",sm:"row"},spacing:4,children:l.map(((r,o)=>t.cloneElement(r,{key:o,sx:[...Array.isArray(r.props.sx)?r.props.sx:[r.props.sx],{zIndex:1}]})))});return r(m,{...{iconComponent:y,headerComponent:h,descriptionComponent:f,actionComponent:u},...x})};export{a as EmptyState};