29 lines
714 B
TypeScript
29 lines
714 B
TypeScript
|
|
import type { ComponentProps } from "react";
|
||
|
|
|
||
|
|
import React from "react";
|
||
|
|
|
||
|
|
import { ContentTextWithSuggestions } from "./content-text-with-suggestions";
|
||
|
|
|
||
|
|
interface ContentTitleWithSuggestionsProps
|
||
|
|
extends 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}
|
||
|
|
/>
|
||
|
|
);
|
||
|
|
};
|