Centralize shared WebUI structural primitives
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { ReactNode } from "react";
|
||||
import FieldLabel from "./help/FieldLabel";
|
||||
import ActionToolbar from "./ActionToolbar";
|
||||
|
||||
type PolicySectionProps = {
|
||||
title?: ReactNode;
|
||||
@@ -44,15 +45,15 @@ export function PolicySection({
|
||||
actions,
|
||||
children,
|
||||
className = "",
|
||||
headingClassName = "subsection-heading split"
|
||||
headingClassName = ""
|
||||
}: PolicySectionProps) {
|
||||
return (
|
||||
<section className={["policy-section", className].filter(Boolean).join(" ")}>
|
||||
{(title || summary || actions) &&
|
||||
<div className={headingClassName}>
|
||||
<ActionToolbar surface="section-header" className={headingClassName}>
|
||||
{title && <h3>{title}</h3>}
|
||||
{actions ?? summary}
|
||||
</div>
|
||||
</ActionToolbar>
|
||||
}
|
||||
{children}
|
||||
</section>);
|
||||
|
||||
Reference in New Issue
Block a user