Skip to content

Commit

Permalink
feat: add question history empty state
Browse files Browse the repository at this point in the history
  • Loading branch information
seelengxd committed Sep 27, 2024
1 parent 60c768d commit 7bb785a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions frontend/app/(authenticated)/questions/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useQuery } from "@tanstack/react-query";

import { UserQuestionMiniDTO } from "@/client";
import ScrollToTopButton from "@/components/navigation/scroll-to-top-button";
import { Button } from "@/components/ui/button";
import { Card } from "@/components/ui/card";
import { LoadingSpinner } from "@/components/ui/loading-spinner";
import { getAnswers } from "@/queries/user-question";
Expand Down Expand Up @@ -54,6 +55,16 @@ function AllQuestions() {
</div>
)
)}
{!isLoading && data!.length === 0 && (
<Card className="mx-auto my-8 p-8 flex flex-col gap-8 max-w-lg">
<h2 className="text-xl">
You don&apos;t have any past questions!
</h2>
<Link href="/ask">
<Button>Ask Jippy a GP question</Button>
</Link>
</Card>
)}
</div>
</div>
</div>
Expand Down

0 comments on commit 7bb785a

Please sign in to comment.