mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
refactor(gitops): migrate git form to react [EE-4849] (#8268)
This commit is contained in:
parent
afe6cd6df0
commit
273a3f9a10
130 changed files with 3194 additions and 1190 deletions
|
@ -1,4 +1,4 @@
|
|||
import { PropsWithChildren, ReactNode } from 'react';
|
||||
import { ComponentProps, PropsWithChildren, ReactNode } from 'react';
|
||||
import clsx from 'clsx';
|
||||
|
||||
import { Tooltip } from '@@/Tip/Tooltip';
|
||||
|
@ -11,11 +11,12 @@ export interface Props {
|
|||
inputId?: string;
|
||||
label: ReactNode;
|
||||
size?: Size;
|
||||
tooltip?: string;
|
||||
tooltip?: ComponentProps<typeof Tooltip>['message'];
|
||||
setTooltipHtmlMessage?: ComponentProps<typeof Tooltip>['setHtmlMessage'];
|
||||
children: ReactNode;
|
||||
errors?: ReactNode;
|
||||
required?: boolean;
|
||||
setTooltipHtmlMessage?: boolean;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function FormControl({
|
||||
|
@ -25,12 +26,14 @@ export function FormControl({
|
|||
tooltip = '',
|
||||
children,
|
||||
errors,
|
||||
required,
|
||||
className,
|
||||
required = false,
|
||||
setTooltipHtmlMessage,
|
||||
}: PropsWithChildren<Props>) {
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
className,
|
||||
'form-group',
|
||||
'after:clear-both after:table after:content-[""]' // to fix issues with float
|
||||
)}
|
||||
|
@ -50,12 +53,7 @@ export function FormControl({
|
|||
|
||||
<div className={sizeClassChildren(size)}>
|
||||
{children}
|
||||
|
||||
{errors && (
|
||||
<span className="help-block">
|
||||
<FormError>{errors}</FormError>
|
||||
</span>
|
||||
)}
|
||||
{errors && <FormError>{errors}</FormError>}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue