mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-02 22:02:39 +02:00
wip
This commit is contained in:
@@ -15,6 +15,36 @@ type AIQuizStripeProps = {
|
|||||||
onComplete?: () => void;
|
onComplete?: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export function AIQuizStripe(props: AIQuizStripeProps) {
|
||||||
|
const { activeQuestionIndex, questionStates, onReview, onComplete } = props;
|
||||||
|
const states = Object.values(questionStates);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="fixed right-0 bottom-0 w-[calc(100vw-255px)] border-t border-gray-200 bg-white p-3">
|
||||||
|
<div className="flex items-center justify-between gap-2">
|
||||||
|
<div className="flex w-full gap-2">
|
||||||
|
{states.map((state, quizIndex) => (
|
||||||
|
<QuizStateButton
|
||||||
|
key={quizIndex}
|
||||||
|
state={state}
|
||||||
|
quizIndex={quizIndex}
|
||||||
|
isActive={quizIndex === activeQuestionIndex}
|
||||||
|
onReview={onReview}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
className="flex shrink-0 items-center gap-2 rounded-xl bg-black px-4 py-2 text-white hover:bg-gray-900 disabled:opacity-70"
|
||||||
|
onClick={onComplete}
|
||||||
|
>
|
||||||
|
Show Results <ArrowRightIcon className="h-4 w-4" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
type QuizStateButtonProps = {
|
type QuizStateButtonProps = {
|
||||||
state: QuestionState;
|
state: QuestionState;
|
||||||
quizIndex: number;
|
quizIndex: number;
|
||||||
@@ -53,33 +83,3 @@ export function QuizStateButton(props: QuizStateButtonProps) {
|
|||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function AIQuizStripe(props: AIQuizStripeProps) {
|
|
||||||
const { activeQuestionIndex, questionStates, onReview, onComplete } = props;
|
|
||||||
const states = Object.values(questionStates);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="fixed right-0 bottom-0 w-[calc(100vw-255px)] border-t border-gray-200 bg-white p-3">
|
|
||||||
<div className="flex items-center justify-between gap-2">
|
|
||||||
<div className="flex w-full gap-2">
|
|
||||||
{states.map((state, quizIndex) => (
|
|
||||||
<QuizStateButton
|
|
||||||
key={quizIndex}
|
|
||||||
state={state}
|
|
||||||
quizIndex={quizIndex}
|
|
||||||
isActive={quizIndex === activeQuestionIndex}
|
|
||||||
onReview={onReview}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button
|
|
||||||
className="flex shrink-0 items-center gap-2 rounded-xl bg-black px-4 py-2 text-white hover:bg-gray-900 disabled:opacity-70"
|
|
||||||
onClick={onComplete}
|
|
||||||
>
|
|
||||||
Show Results <ArrowRightIcon className="h-4 w-4" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user