UNPKG

@porsche-design-system/components-react

Version:

Porsche Design System is a component library designed to help developers create the best experience for software or services distributed by Dr. Ing. h.c. F. Porsche AG.

17 lines (13 loc) 862 B
'use strict'; var jsxRuntime = require('react/jsx-runtime'); require('react'); require('../../provider.cjs'); var utilsEntry = require('../../../../../../components/dist/utils/esm/utils-entry.cjs'); var icon_wrapper = require('../components/icon.wrapper.cjs'); const messageId = 'message'; const StateMessage = ({ hasMessage, state, message, theme }) => { const isErrorState = state === 'error'; return (hasMessage && (jsxRuntime.jsxs("span", { id: messageId, className: "message", role: utilsEntry.getRole(state), children: [jsxRuntime.jsx(icon_wrapper.PIcon, { name: isErrorState ? 'exclamation' : 'check', color: isErrorState ? 'notification-error' : 'notification-success', theme: theme, "aria-hidden": "true" }), message || jsxRuntime.jsx("slot", { name: "message" })] }))); }; exports.StateMessage = StateMessage; exports.messageId = messageId;