fix for PerformerCard Title Display

previously showing '[Object][Object]'
This commit is contained in:
Herpes3000 2024-11-09 15:04:57 +02:00
parent 74e4cc9325
commit b166cf59f7
2 changed files with 10 additions and 4 deletions

View file

@ -231,10 +231,14 @@ export const GridCard: React.FC<ICardProps> = (props: ICardProps) => {
{props.pretitleIcon}
<TruncatedText
text={
<TitleDisplay
text={typeof props.title === "string" ? props.title : String(props.title)}
className="title-display"
/>
typeof props.title === "string" ? (
<TitleDisplay
text={props.title}
className="title-display"
/>
) : (
props.title
)
}
lineCount={2}
/>

View file

@ -6,6 +6,8 @@ interface ITitleDisplayProps {
}
export const TitleDisplay: React.FC<ITitleDisplayProps> = ({ text, className }) => {
if (!text) return null;
return (
<div className={className}>
{text.split('\n').map((line, i) => (