--- import { getMessages } from '../../i18n/messages.ts'; interface Props { locale: string; /** Unique per diagram on the page; prefixes ids inside the SVG. */ uid: string; } const { locale, uid } = Astro.props; const t = getMessages(locale); const arrowV = `${uid}-tga-arrow-v`; const arrowA = `${uid}-tga-arrow-a`; const arrowMix = `${uid}-tga-arrow-mix`; // The atrial communication label is too long for one line above the heart: split it in two. const commWords = t['diagram.label.atrial-communication'].split(' '); const commSplit = Math.ceil(commWords.length / 2); const commLines = [commWords.slice(0, commSplit).join(' '), commWords.slice(commSplit).join(' ')]; // A circulation scheme like the blood-flow diagram: lungs on top, the body below, the right heart // (venous blood) on the viewer's left and the left heart (arterial blood) on the right. // Normal: one loop in series, body → right heart → lungs → left heart → body. The pulmonary // artery rises between the two halves of the heart so that it does not cross the caval veins. // Transposition: the aorta leaves the right ventricle and the pulmonary artery the left // ventricle, so each side of the heart runs its own closed loop. Both arteries leave the bottom // of their ventricle, so the open duct can join them between the two. const normal = { venaCava: 'M175,315 H30 V132 H148', raToRv: 'M185,160 V178', pulmonaryArtery: 'M220,207 H235 V53', pulmonaryVeins: 'M295,30 H400 V132 H322', laToLv: 'M285,160 V178', aorta: 'M320,207 H440 V315 H297', }; const tga = { venaCava: 'M175,325 H30 V132 H148', aorta: 'M185,235 V265 H70 V305 H173', pulmonaryArtery: 'M285,235 V265 H440 V20 H297', pulmonaryVeins: 'M295,40 H400 V132 H322', }; const chamber = { width: 70, height: 55, rx: 10 }; --- {t['diagram.label.lungs']} {t['diagram.label.body']} {t['diagram.label.ra']} {t['diagram.label.rv']} {t['diagram.label.la']} {t['diagram.label.lv']} {commLines[0]} {commLines[1]} {t['diagram.label.open-duct']} {t['diagram.label.venaCava']} {t['diagram.label.pulmonaryVeins']} {t['diagram.label.pulmonaryArtery']} {t['diagram.label.aorta']} {t['diagram.label.aorta']} {t['diagram.label.pulmonaryArtery']}