import Link from "next/link"; import { useRouter } from "next/router"; import { ComponentProps, Fragment } from "react"; import classNames from "@calcom/lib/classNames"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { SVGComponent } from "@calcom/types/SVGComponent"; import { FiChevronRight, FiExternalLink } from "@calcom/ui/components/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; }; const VerticalTabItem = function ({ 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;