--- import { getLastProjects } from '@/content/projects/projects'; import { getSettings } from '@/content/settings/settings'; import CalendarIcon from '@/icons/CalendarIcon.astro'; import { getImageSize, getImageUrl } from '@/lib/images'; import { getProjectRoute } from '@/lib/routing'; import { Image } from 'astro:assets'; interface Props { projects: LastProjectsComponent; } function calculateSizeClasses(amount: number, length: number) { if (amount === 2 || length <= 2) { return "lg:w-[45%] w-full"; } else { return "lg:w-[31%] w-full"; } } const projects = Astro.props.projects; const settings = await getSettings(); const lastProjects = await getLastProjects(projects.amount); const size = calculateSizeClasses(projects.amount, lastProjects.length); --- { (settings.project.enabled && lastProjects.length > 0) && (