mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
feat(containers): migrate labels tab to react [EE-5212] (#10348)
This commit is contained in:
parent
b4b44e6fa4
commit
7acde18930
11 changed files with 159 additions and 67 deletions
31
app/react/docker/containers/CreateView/LabelsTab/Item.tsx
Normal file
31
app/react/docker/containers/CreateView/LabelsTab/Item.tsx
Normal file
|
@ -0,0 +1,31 @@
|
|||
import { FormError } from '@@/form-components/FormError';
|
||||
import { InputGroup } from '@@/form-components/InputGroup';
|
||||
import { ItemProps } from '@@/form-components/InputList';
|
||||
|
||||
import { Label } from './types';
|
||||
|
||||
export function Item({ item, onChange, error }: ItemProps<Label>) {
|
||||
return (
|
||||
<div className="w-full">
|
||||
<div className="flex w-full gap-4">
|
||||
<InputGroup className="w-1/2">
|
||||
<InputGroup.Addon>name</InputGroup.Addon>
|
||||
<InputGroup.Input
|
||||
value={item.name}
|
||||
onChange={(e) => onChange({ ...item, name: e.target.value })}
|
||||
placeholder="e.g. com.example.foo"
|
||||
/>
|
||||
</InputGroup>
|
||||
<InputGroup className="w-1/2">
|
||||
<InputGroup.Addon>value</InputGroup.Addon>
|
||||
<InputGroup.Input
|
||||
value={item.value}
|
||||
onChange={(e) => onChange({ ...item, value: e.target.value })}
|
||||
placeholder="e.g. bar"
|
||||
/>
|
||||
</InputGroup>
|
||||
</div>
|
||||
{error && <FormError>{Object.values(error)[0]}</FormError>}
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue