mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 22:39:41 +02:00
refactor(docker/containers): migrate commands tab to react [EE-5208] (#10085)
This commit is contained in:
parent
46e73ee524
commit
f7366d9788
42 changed files with 1783 additions and 951 deletions
|
@ -1,23 +1,24 @@
|
|||
import { PropsWithChildren } from 'react';
|
||||
import clsx from 'clsx';
|
||||
|
||||
import { useInputGroupContext } from './InputGroup';
|
||||
|
||||
/**
|
||||
* Should wrap all buttons inside a InputGroup
|
||||
*
|
||||
* example:
|
||||
* ```
|
||||
* <InputGroup>
|
||||
* <InputGroup.ButtonWrapper>
|
||||
* <Button>...</Button>
|
||||
* <Button>...</Button>
|
||||
* </InputGroup.ButtonWrapper>
|
||||
* </InputGroup>
|
||||
* ```
|
||||
*/
|
||||
export function InputGroupButtonWrapper({
|
||||
children,
|
||||
}: PropsWithChildren<unknown>) {
|
||||
useInputGroupContext();
|
||||
|
||||
return (
|
||||
<span
|
||||
className={clsx(
|
||||
'input-group-btn [&>button]:!ml-0',
|
||||
// the button should be rounded at the end (right) if it's the last child and start (left) if it's the first child
|
||||
// if the button is in the middle of the group, it shouldn't be rounded
|
||||
'[&:first-child>button]:!rounded-l-[5px] [&:last-child>button]:!rounded-r-[5px] [&>button]:!rounded-none'
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
return <span className="input-group-btn">{children}</span>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue