Hi everyone, I'm trying to dynamically render a module's content depending on the index of an array which I've imported from a .md file. ```js---
import styles from "../styles/globals.css";
import * as members from "../pages/about.md";
export interface Props {
title: string;
}
const { title } = Astro.props;
let bas = 2;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/images/logo.png" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
<body class="font-Lato">
<slot />
<input
type="checkbox"
id={my-modal-${bas}}
class="modal-toggle test-input"
/>
<div class="modal">
<div class="modal-box w-11/12 max-w-5xl">
<h3 class="font-bold text-lg asd">
{members.frontmatter.teamMembers[bas].name}
</h3>
<p class="py-4">
{members.frontmatter.teamMembers[bas].position}
</p>
<div class="modal-action">
<label for={my-modal-${bas}} class="btn">Yay!</label>
</div>
</div>
</div>
<script defer is:inline>
let foo = 0;
const teamMemberContainers = [
...document.querySelector(
"body > astro-island > div > astro-slot > main > section.w-full.min-h-screen.my-10.grid > div > div"
).children,
];
const test = document.querySelector(".test-input");
teamMemberContainers.forEach((member, index) => {
member.addEventListener("click", function () {
bas = index;
console.log(bas);
});
});
</script>
</body>
</html>``` If you look at the script at the bottom of the file, I am mutating the value of bas which is declared in the frontmatter.