{props.heading}
{props.subtitle}
import { SelectorIcon } from "@heroicons/react/outline"; import { CalendarIcon, ClockIcon, CogIcon, ExternalLinkIcon, LinkIcon, LogoutIcon, PuzzleIcon, } from "@heroicons/react/solid"; import { signOut, useSession } from "next-auth/client"; import Link from "next/link"; import { useRouter } from "next/router"; import React, { ReactNode, useEffect, useState } from "react"; import { Toaster } from "react-hot-toast"; import LicenseBanner from "@ee/components/LicenseBanner"; import HelpMenuItemDynamic from "@ee/lib/intercom/HelpMenuItemDynamic"; import classNames from "@lib/classNames"; import { shouldShowOnboarding } from "@lib/getting-started"; import { useLocale } from "@lib/hooks/useLocale"; import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@lib/telemetry"; import { trpc } from "@lib/trpc"; import Loader from "@components/Loader"; import { HeadSeo } from "@components/seo/head-seo"; import Avatar from "@components/ui/Avatar"; import Dropdown, { DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "@components/ui/Dropdown"; import { useViewerI18n } from "./I18nLanguageHandler"; import Logo from "./Logo"; function useMeQuery() { const meQuery = trpc.useQuery(["viewer.me"], { retry(failureCount) { return failureCount > 3; }, }); return meQuery; } function useRedirectToLoginIfUnauthenticated() { const [session, loading] = useSession(); const router = useRouter(); useEffect(() => { if (!loading && !session) { router.replace({ pathname: "/auth/login", query: { callbackUrl: `${location.pathname}${location.search}`, }, }); } // eslint-disable-next-line react-hooks/exhaustive-deps }, [loading, session]); return { loading: loading && !session, }; } function useRedirectToOnboardingIfNeeded() { const router = useRouter(); const query = useMeQuery(); const user = query.data; const [isRedirectingToOnboarding, setRedirecting] = useState(false); useEffect(() => { if (user && shouldShowOnboarding(user)) { setRedirecting(true); } }, [router, user]); useEffect(() => { if (isRedirectingToOnboarding) { router.replace({ pathname: "/getting-started", }); } // eslint-disable-next-line react-hooks/exhaustive-deps }, [isRedirectingToOnboarding]); return { isRedirectingToOnboarding, }; } export function ShellSubHeading(props: { title: ReactNode; subtitle?: ReactNode; actions?: ReactNode; className?: string; }) { return (
{props.subtitle}
}{props.subtitle}