export function selectedItemsLabel({
  labels,
  totalItemsInLabel = 2,
  remaining = (totalRemaining) =>
    totalRemaining > 0 ? `, +${totalRemaining}` : '',
}: {
  labels: string[];
  totalItemsInLabel?: number;
  remaining?: (totalRemaining: number) => string;
}) {
  const totalRemaining = labels.length - totalItemsInLabel;
  return (
    labels.slice(0, totalItemsInLabel).join(', ') + remaining(totalRemaining)
  );
}
