diff --git a/src/components/courses/course-card.tsx b/src/components/courses/course-card.tsx new file mode 100644 index 0000000..a51956d --- /dev/null +++ b/src/components/courses/course-card.tsx @@ -0,0 +1,57 @@ +import { Show } from "solid-js"; +import { Link } from "@tanstack/solid-router"; +import type { Course } from "@/api/client"; +import { Badge } from "@/components/ui/badge"; +import { IconBook, IconChevronRight, IconUsers } from "@/components/ui/icons"; +import { personLabel } from "@/lib/person"; + +export function CourseCard(props: { + course: Course; + term: string; + enrolled?: boolean; + labels: { + capacity: string; + enrolled: string; + kind: string; + }; +}) { + const teachers = () => [props.course.creator, ...(props.course.teachers ?? [])] + .filter((person, index, all) => all.findIndex((row) => row.id === person.id) === index); + + return ( + +
{props.course.description || "—"}
+{props.labels.capacity}
+{props.course.capacity ?? "—"}
+