--- import Layout from '../layouts/Layout.astro'; import TopBar from '../components/TopBar.astro'; import Navbar from '../components/Navbar.astro'; import Footer from '../components/Footer.astro'; import IconBar from '../components/IconBar.astro'; import results from '../../public/results.json'; import configFile from '../../config.json'; // Check if sign out button should be shown var signOut = false; // Import your configuration file const config = configFile const resultDate = config.resultDate; // Calculate current time const currentDate = new Date(); // Create target time const targetTime = new Date(resultDate.year, resultDate.month - 1, resultDate.day, resultDate.hours, resultDate.minutes, resultDate.seconds); console.log("Result date: ", targetTime); console.log("Current date: ", currentDate); // Check if current time is past target time if (currentDate < targetTime) { signOut = true; // Show sign out button const user = Astro.locals.user; // Check if user is logged in if (!user) { return Astro.redirect("/login"); // Redirect to login page if user is not logged in } } const renderStatus = (status:boolean) => status ? "Shortlisted" : "Not Shortlisted"; interface IResult { name: string; college: string; projectIdea: string; shortlisted: boolean; } // console.log(signOut); ---

Result Declarations

{signOut &&
}
{results.map((result : IResult) => (

{result.name}

College: {result.college}

Project Idea: {result.projectIdea}

Status: {renderStatus(result.shortlisted)}

))}