openreplay/frontend/app/components/Session_/Player/Controls/ControlButton.tsx
Delirium c144add4bd
Backend logs UI (#2635)
* backend integrations ui start

* some more ui things

* moving around some integration code

* add dynatrace

* add datadog, useform hook and other things to update backend logging integration forms

* change api queries

* backend logging modals

* tracker: fix some types

* remove deprecated integrations, update types

* some ui fixes and improvements

* update notifications on success/error

* ui: debugging log output, autoclose fix

* ui: some stuff for logs base64str

* ui: improve log formatting,  change datadog data format

* some improvs for logging irm

* ui: fixup for sentry
2024-10-29 15:15:28 +01:00

50 lines
1.2 KiB
TypeScript

import React from 'react';
import cn from 'classnames';
import stl from './controlButton.module.css';
import { Popover, Button } from 'antd';
interface IProps {
label: string;
icon?: string;
disabled?: boolean;
onClick?: () => void;
count?: number;
hasErrors?: boolean;
active?: boolean;
size?: number;
noLabel?: boolean;
labelClassName?: string;
containerClassName?: string;
noIcon?: boolean;
popover?: React.ReactNode;
customTags?: React.ReactNode;
}
const ControlButton = ({
label,
disabled = false,
onClick,
hasErrors = false,
active = false,
popover = undefined,
customTags,
}: IProps) => (
<Popover content={popover} open={popover ? undefined : false}>
<Button
size={'small'}
onClick={onClick}
id={'control-button-' + label.toLowerCase()}
disabled={disabled}
>
{customTags}
{hasErrors && <div className={stl.labels}><div className={stl.errorSymbol} /></div>}
<span className={cn('font-semibold hover:text-main', active ? 'color-main' : 'color-gray-darkest')}>
{label}
</span>
</Button>
</Popover>
);
ControlButton.displayName = 'ControlButton';
export default ControlButton;