mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
refactor(app): migrate env var form section [EE-6232] (#10499)
* refactor(app): migrate env var form section [EE-6232] * allow undoing delete in inputlist
This commit is contained in:
parent
6228314e3c
commit
488393007f
16 changed files with 274 additions and 209 deletions
|
@ -1,4 +1,5 @@
|
|||
import { ComponentProps, InputHTMLAttributes } from 'react';
|
||||
import clsx from 'clsx';
|
||||
|
||||
import { InputGroup } from '../InputGroup';
|
||||
|
||||
|
@ -6,21 +7,29 @@ export function InputLabeled({
|
|||
label,
|
||||
className,
|
||||
size,
|
||||
needsDeletion,
|
||||
id,
|
||||
required,
|
||||
disabled,
|
||||
...props
|
||||
}: {
|
||||
label: string;
|
||||
className?: string;
|
||||
size?: ComponentProps<typeof InputGroup>['size'];
|
||||
needsDeletion?: boolean;
|
||||
} & Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'children'>) {
|
||||
return (
|
||||
<InputGroup className={className} size={size}>
|
||||
<InputGroup.Addon as="label" htmlFor={id}>
|
||||
<InputGroup
|
||||
className={clsx(className, needsDeletion && 'striked')}
|
||||
size={size}
|
||||
>
|
||||
<InputGroup.Addon as="label" htmlFor={id} required={required}>
|
||||
{label}
|
||||
</InputGroup.Addon>
|
||||
<InputGroup.Input
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...props}
|
||||
disabled={disabled || needsDeletion}
|
||||
id={id}
|
||||
/>
|
||||
</InputGroup>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue