import type { ComponentProps } from "react";

import React from "react";

import { ContentTextWithSuggestions } from "./content-text-with-suggestions";

type ContentTitleWithSuggestionsProps = Omit<
  ComponentProps<typeof ContentTextWithSuggestions>,
  "weight"
>;

export const ContentTitleWithSuggestions = ({
  text,
  ellipsis,
  blur = false,
  ...rest
}: ContentTitleWithSuggestionsProps) => {
  const normalizedEllipsis = ellipsis === undefined ? { rows: 2 } : ellipsis;
  const textProps = text === undefined ? {} : { text };

  return (
    <ContentTextWithSuggestions
      weight="bold"
      blur={blur}
      ellipsis={normalizedEllipsis}
      {...textProps}
      {...rest}
    />
  );
};
