import React, { forwardRef } from 'react'; import { useTranslation } from 'react-i18next'; import { useMatch, useNavigate } from 'react-router-dom'; import { Box, Text, Tooltip, TooltipProvider, color, toRem } from 'folds'; import { PageNavHeader } from '../../../components/page'; import { BOTS_PATH, DIRECT_PATH } from '../../paths'; import { isNativePlatform } from '../../../utils/capacitor'; type SegmentProps = { active: boolean; disabled?: boolean; label: string; onClick?: () => void; }; const Segment = forwardRef( ({ active, disabled, label, onClick }, ref) => ( ) ); export function DirectStreamHeader() { const { t } = useTranslation(); const navigate = useNavigate(); const comingSoon = t('Direct.segment_coming_soon'); const directMatch = useMatch({ path: DIRECT_PATH, caseSensitive: true, end: false }); const botsMatch = useMatch({ path: BOTS_PATH, caseSensitive: true, end: false }); const navOpts = { replace: isNativePlatform() }; return ( navigate(DIRECT_PATH, navOpts)} /> {comingSoon} } > {(triggerRef) => ( } active={false} disabled label={t('Direct.segment_channels')} /> )} navigate(BOTS_PATH, navOpts)} /> ); }