Complete the code to import the user context in an Astro component.
import { [1] } from 'astro:context';
The useUser function is the correct way to access user context in Astro components.
Complete the code to retrieve the current user inside the component.
const user = [1]();Calling useUser() returns the current user context inside the component.
Fix the error in the code to correctly display the user's name.
<p>Hello, [1]. Welcome back!</p>The user object has a name property accessed with dot notation: user.name.
Fill both blanks to create a conditional rendering that shows the user's email if logged in.
{user [1] null && <p>Email: [2]</p>}The condition user !== null checks if the user exists, then displays user.email.
Fill all three blanks to destructure user properties and display them.
const { [1], [2] } = user;
<p>Name: [3]</p>Destructure email and name from user, then display name.
