/* eslint-disable sonarjs/cognitive-complexity */ import '../OnboardingQuestionaire.styles.scss'; import { Button, Typography } from 'antd'; import { ArrowRight } from 'lucide-react'; import { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; import { AppState } from 'store/reducers'; import AppReducer from 'types/reducer/app'; interface OrgQuestionsProps { onNext: () => void; } function OrgQuestions({ onNext }: OrgQuestionsProps): JSX.Element { const [organisationName, setOrganisationName] = useState(''); const [usesObservability, setUsesObservability] = useState( null, ); const [observabilityTool, setObservabilityTool] = useState( null, ); const [otherTool, setOtherTool] = useState(''); const [familiarity, setFamiliarity] = useState(null); const [isNextDisabled, setIsNextDisabled] = useState(true); const { user } = useSelector((state) => state.app); useEffect(() => { if ( organisationName !== '' && usesObservability !== null && familiarity !== null && (observabilityTool !== 'Others' || (usesObservability && otherTool !== '')) ) { setIsNextDisabled(false); } else { setIsNextDisabled(true); } }, [ organisationName, usesObservability, familiarity, observabilityTool, otherTool, ]); return (
Welcome, {user?.name}! We'll help you get the most out of SigNoz, whether you're new to observability or a seasoned pro.
setOrganisationName(e.target.value)} />
{usesObservability && (
{observabilityTool === 'Others' ? ( setOtherTool(e.target.value)} /> ) : ( )}
)}
Are you familiar with observability (o11y)?
); } export default OrgQuestions;