--- template/app/src/landing-page/components/RoadmapEpicCard.tsx +++ opensaas-sh/app/src/landing-page/components/RoadmapEpicCard.tsx @@ -0,0 +1,92 @@ +import { Plus } from "lucide-react"; +import { cn } from "../../client/utils"; +import type { GithubEpic } from "../operations"; +import { GithubEpicStatus } from "../operations"; + +type RoadmapEpicCardProps = { + epic: GithubEpic; +}; + +export function RoadmapEpicCard({ epic }: RoadmapEpicCardProps) { + const progress = + epic.totalIssues > 0 + ? Math.round((epic.doneIssues / epic.totalIssues) * 100) + : 0; + const progressColor = getProgressBarColor(epic.status); + const hoverBorderColor = getHoverBorderColor(epic.status); + + return ( + + + {epic.name} + + + + + Progress + + {progress}% ({epic.doneIssues}/{epic.totalIssues}) + + + + + + + + ); +} + +export function RoadmapEpicAddIssueCard() { + return ( + + + + ); +} + +const getProgressBarColor = (status: GithubEpicStatus) => { + switch (status) { + case GithubEpicStatus.Ideas: + return "bg-blue-500"; + case GithubEpicStatus.Planned: + return "bg-green-500"; + case GithubEpicStatus.InProgress: + return "bg-yellow-500"; + case GithubEpicStatus.Done: + return "bg-purple-500"; + default: + return "bg-gray-500"; + } +}; + +const getHoverBorderColor = (status: GithubEpicStatus) => { + switch (status) { + case GithubEpicStatus.Ideas: + return "hover:border-blue-400 dark:hover:border-blue-600"; + case GithubEpicStatus.Planned: + return "hover:border-green-400 dark:hover:border-green-600"; + case GithubEpicStatus.InProgress: + return "hover:border-yellow-400 dark:hover:border-yellow-600"; + case GithubEpicStatus.Done: + return "hover:border-purple-400 dark:hover:border-purple-600"; + default: + return "hover:border-gray-400 dark:hover:border-gray-600"; + } +};