/* eslint-disable jsx-a11y/no-static-element-interactions */
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable jsx-a11y/click-events-have-key-events */
import './LogsManagement.styles.scss';
import cx from 'classnames';
import { useEffect, useState } from 'react';
import { trackEvent } from 'utils/segmentAnalytics';
import ApplicationLogs from './ApplicationLogs/ApplicationLogs';
import Docker from './Docker/Docker';
import ExistingCollectors from './ExistingCollectors/ExistingCollectors';
import Kubernetes from './Kubernetes/Kubernetes';
import Nodejs from './Nodejs/Nodejs';
import SysLogs from './SysLogs/SysLogs';
const supportedLogTypes = [
{
name: 'Kubernetes Pod Logs',
id: 'kubernetes',
imgURL: `Logos/kubernetes.svg`,
},
{
name: 'Docker Container Logs',
id: 'docker',
imgURL: `Logos/docker.svg`,
},
{
name: 'SysLogs',
id: 'syslogs',
imgURL: `Logos/syslogs.svg`,
},
{
name: 'Application Logs',
id: 'application_logs_log_file',
imgURL: `Logos/software-window.svg`,
},
{
name: 'NodeJS Winston Logs ',
id: 'nodejs',
imgURL: `Logos/node-js.svg`,
},
{
name: 'Application Logs using OTEL SDK',
id: 'application_logs_otel_sdk',
imgURL: `Logos/cmd-terminal.svg`,
},
{
name: 'Logs from existing collectors',
id: 'existing_collectors',
imgURL: `Logos/cmd-terminal.svg`,
},
];
export default function LogsManagement({
activeStep,
handleLogTypeSelect,
}: {
activeStep: number;
handleLogTypeSelect: (id: string) => any;
}): JSX.Element {
const [selectedLogsType, setSelectedLogsType] = useState('kubernetes');
useEffect(() => {
// on language select
trackEvent('Onboarding: Logs Management', {
selectedLogsType,
activeStep,
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [selectedLogsType]);
const renderSelectedLanguageSetupInstructions = ():
| JSX.Element
| undefined => {
switch (selectedLogsType) {
case 'kubernetes':
return