Files
Anelia-Wolf/src/components/ui/MetaLines.tsx
T
2026-09-06 17:21:52 +02:00

29 lines
881 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { PlaceholderText } from "./Facts";
export interface MetaLinesProps {
/** „Online · DE/EN · [Dauer]“ */
text: string;
}
/**
* A ledger meta string, one item per line. The DM Mono meta columns are narrow
* (1.5–2 fr), so a single string breaks mid-separator („Online · DE/EN ·“ /
* „[Dauer]“, or a line opening with a lone „·“). Splitting on „ · “ keeps every
* item whole and the separator out of the line breaks.
*/
export function MetaLines({ text }: MetaLinesProps) {
const parts = text.split(/\s+·\s+/).filter((p) => p.length > 0);
if (parts.length < 2) return <PlaceholderText text={text} />;
return (
<>
{parts.map((part, i) => (
<span key={`${part}-${i}`} className="block whitespace-nowrap">
<PlaceholderText text={part} />
</span>
))}
</>
);
}
export default MetaLines;