Files
my-website-v2/frontend/routes/projects/index.tsx

62 lines
1.8 KiB
TypeScript
Raw Normal View History

2025-06-29 23:41:20 -04:00
import { FreshContext, Handlers, PageProps } from "$fresh/server.ts";
2024-12-02 18:29:45 -05:00
import { ProjectCard } from "../../islands/ProjectCard.tsx";
2025-06-29 23:41:20 -04:00
interface ProjectData {
project_id: number;
title: string;
repo?: string;
summary: string;
tech: string;
wip?: boolean;
created_at: string;
}
export const handler: Handlers<ProjectData> = {
async GET(_req: Request, ctx: FreshContext) {
const projectResult = await fetch(
`${Deno.env.get("BASE_URI_API")}/projects`,
);
const projectData = await projectResult.json();
return ctx.render({
projectData,
});
},
};
export default function Projects({ data }: PageProps<ProjectData>) {
const { projectData: projects } = data;
2024-12-02 18:29:45 -05:00
return (
<div class="space-y-12 px-10 py-8 sm:min-h-screen bg-[#313244]">
<section
id="projects"
2025-07-14 20:09:10 -04:00
class="lg:grid-cols-desktop grid scroll-mt-8 grid-cols-1 gap-x-4 gap-y-2 bg-[#313244] "
2024-12-02 18:29:45 -05:00
>
<h1 class="text-3xl text-white font-bold uppercase text-center">
Projects
</h1>
2025-07-14 20:09:10 -04:00
<p class="md:text-lg sm:text-md text-white">
Here's a collection of software and electronics projects I've been
tinkering with during my free time - some are ongoing adventures,
others are finished experiments, but they've all been exciting
challenges that keep me busy when I'm not doing the "real work" stuff!
</p>
2025-06-29 23:41:20 -04:00
<div class="grid grid-cols-1 sm:grid-cols-2">
{projects.map((project: any) => {
return (
<ProjectCard
title={project.title}
repo={project.repo ?? undefined}
summary={project.summary}
tech={project.tech}
wip={project.wip ?? true}
/>
);
})}
2024-12-02 18:29:45 -05:00
</div>
</section>
</div>
);
}