mirror of
https://github.com/SigNoz/signoz.git
synced 2026-03-14 17:12:15 +00:00
* chore: updated eslint base config with comments * chore: add eslint rules for no-else-return and curly * chore: use isNumber from lodash-es * chore: add eslint rules for no-console * chore: update eslint overrides * chore: sort all files * chore: fix tests
63 lines
1.4 KiB
TypeScript
63 lines
1.4 KiB
TypeScript
import { Color } from '@signozhq/design-tokens';
|
|
import { Button } from 'antd';
|
|
import { Binoculars, DraftingCompass, ScrollText } from 'lucide-react';
|
|
|
|
import './GraphControlsPanel.styles.scss';
|
|
|
|
interface GraphControlsPanelProps {
|
|
id: string;
|
|
onViewLogsClick?: () => void;
|
|
onViewTracesClick: () => void;
|
|
onViewAPIMonitoringClick?: () => void;
|
|
}
|
|
|
|
function GraphControlsPanel({
|
|
id,
|
|
onViewLogsClick,
|
|
onViewTracesClick,
|
|
onViewAPIMonitoringClick,
|
|
}: GraphControlsPanelProps): JSX.Element {
|
|
return (
|
|
<div id={id} className="graph-controls-panel">
|
|
<Button
|
|
type="link"
|
|
icon={<DraftingCompass size={14} />}
|
|
size="small"
|
|
onClick={onViewTracesClick}
|
|
style={{ color: Color.BG_VANILLA_100 }}
|
|
>
|
|
View traces
|
|
</Button>
|
|
{onViewLogsClick && (
|
|
<Button
|
|
type="link"
|
|
icon={<ScrollText size={14} />}
|
|
size="small"
|
|
onClick={onViewLogsClick}
|
|
style={{ color: Color.BG_VANILLA_100 }}
|
|
>
|
|
View logs
|
|
</Button>
|
|
)}
|
|
{onViewAPIMonitoringClick && (
|
|
<Button
|
|
type="link"
|
|
icon={<Binoculars size={14} />}
|
|
size="small"
|
|
onClick={onViewAPIMonitoringClick}
|
|
style={{ color: Color.BG_VANILLA_100 }}
|
|
>
|
|
View External APIs
|
|
</Button>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
GraphControlsPanel.defaultProps = {
|
|
onViewLogsClick: undefined,
|
|
onViewAPIMonitoringClick: undefined,
|
|
};
|
|
|
|
export default GraphControlsPanel;
|