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.26 kB
"use client"; "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("@mui/material/Box"),i=require("@mui/material/Stack"),a=require("@mui/material/Typography"),s=require("./EmptyState.component.js"),n=require("./constant.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=o(t),p=o(r),c=o(i),l=o(a);exports.EmptyState=t=>{const{size:r="medium",icon:i,header:a,description:o,actions:m,...u}=t,x={iconComponent:i,headerComponent:e.jsx(p.default,{sx:{mt:i?4:0},children:"string"==typeof a?e.jsx(l.default,{variant:"small"===r?"subtitle1":"h6","data-testid":`${n.prefix}-header`,className:`${n.prefix}-header`,children:a}):a}),descriptionComponent:o&&e.jsx(p.default,{sx:{mt:2},children:"string"==typeof o?e.jsx(l.default,{variant:"small"===r?"body2":"body1",color:"text.secondary","data-testid":`${n.prefix}-description`,className:`${n.prefix}-description`,children:o}):o}),actionComponent:Array.isArray(m)&&e.jsx(c.default,{sx:{mt:6},direction:{xs:"column",sm:"row"},spacing:4,children:m.map(((e,t)=>d.default.cloneElement(e,{key:t,sx:[...Array.isArray(e.props.sx)?e.props.sx:[e.props.sx],{zIndex:1}]})))})};return e.jsx(s.EmptyStateComponent,{...x,...u})};