1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 15:29:42 +02:00

refactor(app): app service form to react [EE-5415] (#8994)

This commit is contained in:
Ali 2023-05-31 17:58:41 +12:00 committed by GitHub
parent 2d05103fed
commit 69776b4863
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 1224 additions and 538 deletions

View file

@ -1,18 +1,28 @@
import { ComponentType, PropsWithChildren } from 'react';
import clsx from 'clsx';
import { useInputGroupContext } from './InputGroup';
type BaseProps<TProps> = {
as?: ComponentType<TProps> | string;
required?: boolean;
};
export function InputGroupAddon<TProps>({
children,
as = 'span',
required,
...props
}: PropsWithChildren<{ as?: ComponentType<TProps> | string } & TProps>) {
}: PropsWithChildren<BaseProps<TProps> & TProps>) {
useInputGroupContext();
const Component = as as 'span';
return (
// eslint-disable-next-line react/jsx-props-no-spreading
<Component className="input-group-addon" {...props}>
<Component
className={clsx('input-group-addon', required && 'required')}
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
>
{children}
</Component>
);