shlink-web-client/src/utils/forms/LabeledFormGroup.tsx
2022-03-05 19:57:48 +01:00

17 lines
472 B
TypeScript

import { FC, ReactNode } from 'react';
interface LabeledFormGroupProps {
label: ReactNode;
noMargin?: boolean;
className?: string;
labelClassName?: string;
}
export const LabeledFormGroup: FC<LabeledFormGroupProps> = (
{ children, label, className = '', labelClassName = '', noMargin = false },
) => (
<div className={`${className} ${noMargin ? '' : 'mb-3'}`}>
<label className={`form-label ${labelClassName}`}>{label}</label>
{children}
</div>
);