Files
Trilium/apps/client/src/widgets/react/FormGroup.tsx

22 lines
613 B
TypeScript
Raw Normal View History

2025-08-04 20:34:47 +03:00
import { ComponentChildren } from "preact";
interface FormGroupProps {
label: string;
2025-08-04 21:17:35 +03:00
title?: string;
className?: string;
2025-08-04 20:34:47 +03:00
children: ComponentChildren;
2025-08-04 21:17:35 +03:00
description?: string;
2025-08-04 20:34:47 +03:00
}
2025-08-04 21:17:35 +03:00
export default function FormGroup({ label, title, className, children, description }: FormGroupProps) {
2025-08-04 20:34:47 +03:00
return (
2025-08-04 21:17:35 +03:00
<div className={`form-group ${className}`} title={title}>
2025-08-04 20:34:47 +03:00
<label style={{ width: "100%" }}>
{label}
{children}
</label>
2025-08-04 21:17:35 +03:00
{description && <small className="form-text text-muted">{description}</small>}
2025-08-04 20:34:47 +03:00
</div>
);
}