feat(frontend): add progress tracking
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import { CheckCircle } from "lucide-react";
|
||||
import { isQuestionCompleted } from "@/lib/progress";
|
||||
|
||||
interface CompletionIndicatorProps {
|
||||
slug: string;
|
||||
}
|
||||
|
||||
export function CompletionIndicator({ slug }: CompletionIndicatorProps) {
|
||||
const [completed, setCompleted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setCompleted(isQuestionCompleted(slug));
|
||||
}, [slug]);
|
||||
|
||||
if (!completed) return null;
|
||||
|
||||
return (
|
||||
<CheckCircle
|
||||
className="h-4 w-4 text-green-500 flex-shrink-0"
|
||||
aria-label="Completed"
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user