From 0ac9e7ffd60f86e54556066c5e4f96e1754ddd9d Mon Sep 17 00:00:00 2001 From: MekalaNagarajan_Centrica Date: Thu, 18 Jul 2024 11:01:56 +0100 Subject: [PATCH] fix: link to components --- src/components/LinkToComponent.astro | 24 +++++++++++++++++++----- src/components/placement.astro | 8 ++++---- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/components/LinkToComponent.astro b/src/components/LinkToComponent.astro index a1175645c..4358a13da 100644 --- a/src/components/LinkToComponent.astro +++ b/src/components/LinkToComponent.astro @@ -1,11 +1,25 @@ --- const { name } = Astro.props; +const nestedElements = name.split(' > '); --- { - name?.startsWith('ns') ? ( - <{name}> - ) : ( - <{name}> + nestedElements && ( + nestedElements?.reverse().map((element, index) => { + return ( + + { + (index > 0) && ( wrapped in ) + } + { + element?.startsWith('ns') ? ( + <{element}> + ) : ( + <{element}> + ) + } + + ) + }) ) -} \ No newline at end of file +} diff --git a/src/components/placement.astro b/src/components/placement.astro index a1f29f95d..469e19da1 100644 --- a/src/components/placement.astro +++ b/src/components/placement.astro @@ -12,10 +12,10 @@ const placements = ceJsDoc.find((tag) => tag.name === name)?.placements;

The {name} component can be used in the following components: