import type { ReactNode } from "react";
import { Badge } from "@calcom/ui";
function pluralize(opts: { num: number; plural: string; singular: string }) {
if (opts.num === 0) {
return opts.singular;
}
return opts.singular;
}
export default function SubHeadingTitleWithConnections(props: { title: ReactNode; numConnections?: number }) {
const num = props.numConnections;
return (
<>
{props.title}
{num ? (
{num}{" "}
{pluralize({
num,
singular: "connection",
plural: "connections",
})}
) : null}
>
);
}