UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

84 lines (83 loc) 2.28 kB
import Text_default from "../Text/Text.js"; import Octicon from "../Octicon/Octicon.js"; import SelectPanel_module_css_default from "./SelectPanel.module.css.js"; import { c } from "react-compiler-runtime"; import { clsx } from "clsx"; import { jsx, jsxs } from "react/jsx-runtime"; import { AlertIcon } from "@primer/octicons-react"; //#region src/SelectPanel/SelectPanelMessage.tsx const SelectPanelMessage = (t0) => { const $ = c(17); const { variant, title, children, className, icon: CustomIcon, action } = t0; const IconComponent = CustomIcon || (variant !== "empty" ? AlertIcon : void 0); let t1; if ($[0] !== className) { t1 = clsx(SelectPanel_module_css_default.Message, className); $[0] = className; $[1] = t1; } else t1 = $[1]; let t2; if ($[2] !== IconComponent || $[3] !== variant) { t2 = IconComponent && /*#__PURE__*/ jsx(Octicon, { icon: IconComponent, className: SelectPanel_module_css_default.MessageIcon, "data-variant": variant, "data-component": "SelectPanel.MessageIcon" }); $[2] = IconComponent; $[3] = variant; $[4] = t2; } else t2 = $[4]; let t3; if ($[5] !== title) { t3 = /*#__PURE__*/ jsx(Text_default, { className: SelectPanel_module_css_default.MessageTitle, "data-component": "SelectPanel.MessageTitle", children: title }); $[5] = title; $[6] = t3; } else t3 = $[6]; let t4; if ($[7] !== children) { t4 = /*#__PURE__*/ jsx(Text_default, { className: SelectPanel_module_css_default.MessageBody, "data-component": "SelectPanel.MessageBody", children }); $[7] = children; $[8] = t4; } else t4 = $[8]; let t5; if ($[9] !== action) { t5 = action && /*#__PURE__*/ jsx("div", { className: SelectPanel_module_css_default.MessageAction, "data-component": "SelectPanel.MessageAction", children: action }); $[9] = action; $[10] = t5; } else t5 = $[10]; let t6; if ($[11] !== t1 || $[12] !== t2 || $[13] !== t3 || $[14] !== t4 || $[15] !== t5) { t6 = /*#__PURE__*/ jsxs("div", { className: t1, "data-component": "SelectPanel.Message", children: [ t2, t3, t4, t5 ] }); $[11] = t1; $[12] = t2; $[13] = t3; $[14] = t4; $[15] = t5; $[16] = t6; } else t6 = $[16]; return t6; }; //#endregion export { SelectPanelMessage };