UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

61 lines (60 loc) • 2.01 kB
"use client"; import Tag from "../../base-ui/Tag/Tag.mjs"; import { LandingActions } from "../landingActions.mjs"; import { styles } from "./style.mjs"; import { memo } from "react"; import { jsx, jsxs } from "react/jsx-runtime"; import { cx } from "antd-style"; //#region src/awesome/LandingSection/LandingSection.tsx const LandingSection = memo(({ actions, align = "start", children, className, description, divider = true, eyebrow, eyebrowColor = "blue", extra, id, onNavigate, renderLink, title, ...rest }) => { const headingId = id ? `${id}-title` : void 0; const hasActions = Boolean(actions?.length); const hasAside = hasActions || Boolean(extra); const hasHeader = Boolean(eyebrow || title || description || hasAside); return /* @__PURE__ */ jsxs("section", { "aria-labelledby": title ? headingId : void 0, className: cx(styles.root, className), "data-divider": divider, id, ...rest, children: [hasHeader && /* @__PURE__ */ jsxs("div", { className: styles.header, "data-align": align, children: [/* @__PURE__ */ jsxs("div", { className: styles.heading, children: [ eyebrow && /* @__PURE__ */ jsx(Tag, { className: styles.eyebrow, color: eyebrowColor, shape: "round", children: eyebrow }), title && /* @__PURE__ */ jsx("h2", { className: styles.title, id: headingId, children: title }), description && /* @__PURE__ */ jsx("p", { className: styles.description, children: description }) ] }), hasAside && /* @__PURE__ */ jsxs("div", { className: styles.extra, children: [hasActions && /* @__PURE__ */ jsx(LandingActions, { actions, renderLink, size: "small", onNavigate }), extra] })] }), children && /* @__PURE__ */ jsx("div", { className: hasHeader ? styles.body : void 0, children })] }); }); LandingSection.displayName = "LandingSection"; //#endregion export { LandingSection as default }; //# sourceMappingURL=LandingSection.mjs.map