Leaflet Blog in Deno Fresh
1import { useSignal } from "@preact/signals";
2import { useEffect } from "preact/hooks";
3import { ProjectListItem } from "../components/project-list-item.tsx";
4
5interface Project {
6 id: string;
7 title: string;
8 description: string;
9 technologies: string[];
10 url: string;
11 demo?: string;
12 year: string;
13 status: "active" | "completed" | "maintained" | "archived";
14}
15
16export default function ProjectList(
17 { projects: initialProjects }: { projects: Project[] },
18) {
19 const projects = useSignal(initialProjects);
20
21 useEffect(() => {
22 projects.value = initialProjects;
23 }, [initialProjects]);
24
25 return (
26 <>
27 {projects.value?.map((project) => (
28 <ProjectListItem
29 key={project.id}
30 project={project}
31 />
32 ))}
33 </>
34 );
35}