1
0
Fork 0
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:
Chaim Lev-Ari 2023-09-04 19:07:29 +01:00 committed by GitHub
parent 46e73ee524
commit f7366d9788
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 1783 additions and 951 deletions

View file

@ -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>;
}