/** * This Source Code is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright (c) Infonomic Company Limited */ import type { ReactNode } from 'react' import cx from 'clsx' import styles from './group.module.css' interface AdminGroupProps { /** Optional heading rendered as a `` above the cluster. */ label?: string children: ReactNode className?: string } /** * Labelled fieldset clustering related fields together. * * Used by `FormRenderer` when a `CollectionAdminConfig` declares a `groups` * primitive. Renders a bordered, padded `
` with an optional * `` for the label. * * Stable override handles: `.byline-admin-group` on the fieldset and * `.byline-admin-group-legend` on the legend (alongside the hashed * CSS-modules locals). */ export const AdminGroup = ({ label, children, className }: AdminGroupProps) => { return (
{label && {label}} {children}
) }