import * as React from "react"; import { messagePanelContainer, vertAlignHeading } from "../style"; import { Card } from "../../card"; import { SpacingBox } from "../../styleUtils/modifiers"; import { HeadingText2 } from "../../styleUtils/typography"; import { breakWord } from "../../shared/styles/styleUtils"; import MessagePanelActions from "./MessagePanelActions"; import { Icon } from "../../icon"; import { SystemIcons } from "../../icons/dist/system-icons-enum"; import { themeError } from "../../design-tokens/build/js/designTokens"; export interface MessagePanelProps { /** * The tone of the message */ appearance?: "error" | "standard"; /** * A heading to provide a brief overview of why an empty state is appearing */ heading: string; /** * The most important action a user can take in the empty state */ primaryAction?: React.ReactNode; /** * A secondary action a user can take in the empty state */ secondaryAction?: React.ReactNode; children: React.ReactNode; } const MessagePanel = ({ appearance, heading, children, primaryAction, secondaryAction }: MessagePanelProps) => { const hasActions = primaryAction || secondaryAction; return (
{appearance === "error" ? ( <> {heading} ) : ( heading )} {children && ( {children} )} {(primaryAction || secondaryAction) && ( )}
); }; MessagePanel.defaultProps = { appearance: "standard" }; export default MessagePanel;