2024-08-01 01:47:54 +08:00
|
|
|
import React from 'react';
|
|
|
|
import Styled from './styles';
|
|
|
|
|
2024-08-22 21:51:00 +08:00
|
|
|
interface PluginHelperButtonComponentProps {
|
2024-08-01 01:47:54 +08:00
|
|
|
dark: boolean;
|
|
|
|
bottom: boolean;
|
|
|
|
right: boolean;
|
|
|
|
icon: string;
|
|
|
|
label: string;
|
2024-08-22 21:51:00 +08:00
|
|
|
onClick: (args: { browserClickEvent: React.MouseEvent<HTMLElement> }) => void;
|
2024-08-01 01:47:54 +08:00
|
|
|
}
|
|
|
|
|
2024-08-22 21:51:00 +08:00
|
|
|
const PluginHelperButtonComponent = ({
|
2024-08-01 01:47:54 +08:00
|
|
|
dark = false,
|
|
|
|
bottom = false,
|
2024-08-22 21:51:00 +08:00
|
|
|
onClick,
|
2024-08-01 01:47:54 +08:00
|
|
|
right,
|
|
|
|
icon,
|
|
|
|
label,
|
2024-08-22 21:51:00 +08:00
|
|
|
}: PluginHelperButtonComponentProps) => (
|
2024-08-01 01:47:54 +08:00
|
|
|
<Styled.PluginButtonWrapper
|
|
|
|
{...{
|
|
|
|
dark,
|
|
|
|
bottom,
|
|
|
|
right,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<Styled.PluginButton
|
|
|
|
color="default"
|
|
|
|
icon={icon}
|
|
|
|
size="sm"
|
2024-08-22 22:29:35 +08:00
|
|
|
onClick={(e: React.MouseEvent<HTMLElement>) => onClick({ browserClickEvent: e })}
|
2024-08-01 01:47:54 +08:00
|
|
|
hideLabel
|
|
|
|
label={label}
|
|
|
|
data-test="switchButton"
|
|
|
|
/>
|
|
|
|
</Styled.PluginButtonWrapper>
|
|
|
|
);
|
|
|
|
|
2024-08-22 21:51:00 +08:00
|
|
|
export default PluginHelperButtonComponent;
|