@itwin/itwinui-react
Version:
A react component library for iTwinUI
73 lines (72 loc) • 1.59 kB
JavaScript
import * as React from 'react';
import { Box } from '../../utils/index.js';
import cx from 'classnames';
export const NonIdealState = React.forwardRef((props, forwardedRef) => {
let {
className,
svg,
heading,
description,
actions,
illustrationProps,
titleProps,
descriptionProps,
actionsProps,
...rest
} = props;
return React.createElement(
Box,
{
className: cx('iui-non-ideal-state', className),
ref: forwardedRef,
...rest,
},
React.createElement(
Box,
{
as: 'div',
...illustrationProps,
className: cx(
'iui-non-ideal-state-illustration',
illustrationProps?.className,
),
},
svg,
),
heading &&
React.createElement(
Box,
{
as: 'div',
...titleProps,
className: cx('iui-non-ideal-state-title', titleProps?.className),
},
heading,
),
description &&
React.createElement(
Box,
{
as: 'div',
...descriptionProps,
className: cx(
'iui-non-ideal-state-description',
descriptionProps?.className,
),
},
description,
),
actions &&
React.createElement(
Box,
{
as: 'div',
...actionsProps,
className: cx('iui-non-ideal-state-actions', actionsProps?.className),
},
actions,
),
);
});
if ('development' === process.env.NODE_ENV)
NonIdealState.displayName = 'NonIdealState';