Complete the code to define a dynamic route file for a user profile page.
src/pages/users/[1].astroIn Astro, dynamic route parameters are defined using square brackets around the parameter name, like [id].
Complete the code to access the dynamic route parameter inside the Astro component.
const { params } = Astro; const userId = params.[1];The dynamic parameter name used in the filename (e.g., [id]) is accessed via params.id.
Fix the error in the code to correctly display the dynamic parameter in the page.
<h1>User ID: [1]</h1>userId without declaring them.Astro.In Astro components, dynamic parameters are accessed via Astro.params. So to display the ID, use {Astro.params.id}.
Fill both blanks to create a dynamic route that captures a post slug and displays it.
---
const { params } = Astro;
const slug = params.[1];
---
<h1>Post: [2]</h1>id and slug.The dynamic parameter is named slug in the filename, so access it with params.slug and display it with {slug}.
Fill all three blanks to create a nested dynamic route for category and product, and display both parameters.
---
const { params } = Astro;
const category = params.[1];
const product = params.[2];
---
<h1>Category: [3]</h1>
<p>Product: {product}</p>For nested dynamic routes like [category]/[product].astro, access parameters as params.category and params.product. Display the category with {category}.
