Fix Hyvor component to properly compute page ID

Added proper prop handling and fallback for Astro.url.pathname
to ensure the page-id is correctly passed to the comments widget.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Neeldhara Misra 2026-02-20 14:13:34 +05:30
parent 5a241fa57d
commit 81cca50f34

View file

@ -1,10 +1,16 @@
---
// Hyvor Talk comments component
interface Props {
pageId?: string;
}
const { pageId } = Astro.props;
const computedPageId = pageId ?? Astro.url.pathname;
---
<script async src="https://talk.hyvor.com/embed/embed.js" type="module"></script>
<hyvor-talk-comments
website-id="15040"
page-id={Astro.url.pathname}
page-id={computedPageId}
reactions-text=""
></hyvor-talk-comments>