import React from 'react';
import {HelpMark, Text} from '@gravity-ui/uikit';
import {cn} from '../../../../utils/cn';
const b = cn('ydb-table-form-dialog');
export function FormSection({
title,
note,
children,
}: {
title?: string;
note?: string;
children: React.ReactNode;
}) {
return (
{title ? (
{title}
{note ? (
{note}
) : null}
) : null}
{children}
);
}
export function FormRow({
title,
note,
htmlFor,
children,
}: {
title?: string;
note?: string;
htmlFor?: string;
children: React.ReactNode;
}) {
let labelTitleNode: React.ReactNode = null;
if (title) {
if (htmlFor) {
labelTitleNode = (
);
} else {
labelTitleNode = {title};
}
}
return (
{labelTitleNode}
{note ? (
{note}
) : null}
{children}
);
}
export function FormFieldError({message}: {message?: string}) {
if (!message) {
return null;
}
return (
{message}
);
}