first publish
This commit is contained in:
commit
b8e41b4d55
147 files changed
+19367
No files matched your search
@@ -0,0 +1,28 @@
|
||||
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;
|
||||
Reference in new issue
Block a user