mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-07-30 15:41:47 +00:00
* Extract sidebar to new component * Add sidebar toggle * Fix scrollbars sometimes appearing even at maximum zoom-out
27 lines
692 B
TypeScript
27 lines
692 B
TypeScript
import {FormattedMessage} from 'react-intl';
|
|
import {GedcomData} from '../../util/gedcom_util';
|
|
|
|
interface Props {
|
|
gedcom: GedcomData;
|
|
indi: string;
|
|
}
|
|
|
|
export function CollapsedDetails(props: Props) {
|
|
const entries = props.gedcom.indis[props.indi].tree;
|
|
const nameEntry = entries.find((entry) => entry.tag === 'NAME');
|
|
|
|
const fullName = nameEntry?.data.replaceAll('/', '') ?? '';
|
|
|
|
return (
|
|
<div className="collapsed-details">
|
|
{fullName ? (
|
|
<span className="vertical-name">{fullName}</span>
|
|
) : (
|
|
<span className="vertical-name">
|
|
<FormattedMessage id="name.unknown_name" defaultMessage="N.N." />
|
|
</span>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|