import Link from "next/link"; import { useRouter } from "next/router"; import type { ComponentProps } from "react"; import { Fragment } from "react"; import classNames from "@calcom/lib/classNames"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import type { SVGComponent } from "@calcom/types/SVGComponent"; import { ChevronRight, ExternalLink } from "../../icon"; import { Skeleton } from "../../skeleton"; export type VerticalTabItemProps = { name: string; info?: string; icon?: SVGComponent; disabled?: boolean; children?: VerticalTabItemProps[]; textClassNames?: string; className?: string; isChild?: boolean; hidden?: boolean; disableChevron?: boolean; href: string; isExternalLink?: boolean; linkProps?: Omit, "href">; avatar?: string; iconClassName?: string; }; const VerticalTabItem = ({ name, href, info, isChild, disableChevron, linkProps, ...props }: VerticalTabItemProps) => { const { t } = useLocale(); const { asPath } = useRouter(); const isCurrent = asPath.startsWith(href); return ( {!props.hidden && ( <> {props.icon && ( )}
{t(name)} {props.isExternalLink ? : null} {info && ( {t(info)} )}
{!disableChevron && isCurrent && (
)} {props.children?.map((child) => ( ))} )}
); }; export default VerticalTabItem;