mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
feat(home): move edge device to view [EE-4559] (#8189)
Co-authored-by: matias.spinarolli <matias.spinarolli@portainer.io>
This commit is contained in:
parent
b4a6f6911c
commit
7fe0712b61
72 changed files with 988 additions and 1593 deletions
|
@ -25,7 +25,9 @@ type Color =
|
|||
| 'none';
|
||||
type Size = 'xsmall' | 'small' | 'medium' | 'large';
|
||||
|
||||
export interface Props extends AriaAttributes, AutomationTestingProps {
|
||||
export interface Props<TasProps = unknown>
|
||||
extends AriaAttributes,
|
||||
AutomationTestingProps {
|
||||
icon?: ReactNode | ComponentType<unknown>;
|
||||
|
||||
color?: Color;
|
||||
|
@ -34,10 +36,12 @@ export interface Props extends AriaAttributes, AutomationTestingProps {
|
|||
title?: string;
|
||||
className?: string;
|
||||
type?: Type;
|
||||
as?: ComponentType<TasProps> | string;
|
||||
onClick?: MouseEventHandler<HTMLButtonElement>;
|
||||
props?: TasProps;
|
||||
}
|
||||
|
||||
export function Button({
|
||||
export function Button<TasProps = unknown>({
|
||||
type = 'button',
|
||||
color = 'primary',
|
||||
size = 'small',
|
||||
|
@ -47,11 +51,13 @@ export function Button({
|
|||
title,
|
||||
icon,
|
||||
children,
|
||||
|
||||
as = 'button',
|
||||
props,
|
||||
...ariaProps
|
||||
}: PropsWithChildren<Props>) {
|
||||
}: PropsWithChildren<Props<TasProps>>) {
|
||||
const Component = as as 'button';
|
||||
return (
|
||||
<button
|
||||
<Component
|
||||
/* eslint-disable-next-line react/button-has-type */
|
||||
type={type}
|
||||
disabled={disabled}
|
||||
|
@ -60,10 +66,12 @@ export function Button({
|
|||
title={title}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...ariaProps}
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...props}
|
||||
>
|
||||
{icon && <Icon icon={icon} size={getIconSize(size)} />}
|
||||
{children}
|
||||
</button>
|
||||
</Component>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue