2021-12-09 18:44:22 +01:00
|
|
|
/*
|
2024-09-09 14:57:16 +01:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2021-12-09 18:44:22 +01:00
|
|
|
Copyright 2021 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
2025-01-06 11:18:54 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
2024-09-09 14:57:16 +01:00
|
|
|
Please see LICENSE files in the repository root for full details.
|
2021-12-09 18:44:22 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import React, { ReactNode, HTMLAttributes } from "react";
|
|
|
|
|
import classNames from "classnames";
|
|
|
|
|
|
2023-05-24 14:37:10 +12:00
|
|
|
import { SettingsSubsectionText } from "./shared/SettingsSubsection";
|
|
|
|
|
|
2021-12-09 18:44:22 +01:00
|
|
|
interface Props extends HTMLAttributes<HTMLFieldSetElement> {
|
|
|
|
|
// section title
|
|
|
|
|
legend: string | ReactNode;
|
|
|
|
|
description?: string | ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const SettingsFieldset: React.FC<Props> = ({ legend, className, children, description, ...rest }) => (
|
|
|
|
|
<fieldset {...rest} className={classNames("mx_SettingsFieldset", className)}>
|
|
|
|
|
<legend className="mx_SettingsFieldset_legend">{legend}</legend>
|
2023-05-24 14:37:10 +12:00
|
|
|
{description && (
|
|
|
|
|
<div className="mx_SettingsFieldset_description">
|
|
|
|
|
<SettingsSubsectionText>{description}</SettingsSubsectionText>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2023-05-29 10:20:44 +12:00
|
|
|
<div className="mx_SettingsFieldset_content">{children}</div>
|
2021-12-09 18:44:22 +01:00
|
|
|
</fieldset>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export default SettingsFieldset;
|