stash/ui/v2.5/src/components/Shared/TitleDisplay.tsx
Herpes3000 908081e82c Grid Card Title Display Enhancements
Allows the use of line breaks in Titles for Better Text Layouts
2024-11-08 22:46:17 +02:00

19 lines
No EOL
429 B
TypeScript

import React from 'react';
interface ITitleDisplayProps {
text: string;
className?: string;
}
export const TitleDisplay: React.FC<ITitleDisplayProps> = ({ text, className }) => {
return (
<div className={className}>
{text.split('\n').map((line, i) => (
<React.Fragment key={i}>
{line}
{i < text.split('\n').length - 1 && <br />}
</React.Fragment>
))}
</div>
);
};