Skip to content

Commit 3bb3b7e

Browse files
committed
chore: display quote pending list
1 parent 8d1fd57 commit 3bb3b7e

File tree

3 files changed

+48
-5
lines changed

3 files changed

+48
-5
lines changed

src/components/H2.tsx renamed to src/components/Headings.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,11 @@ export function H2({ children }: PropsWithChildren<unknown>) {
77
</h2>
88
)
99
}
10+
11+
export function H3({ children }: PropsWithChildren<unknown>) {
12+
return (
13+
<h3 className="scroll-m-20 text-3xl font-extrabold tracking-tight lg:text-4xl">
14+
{children}
15+
</h3>
16+
)
17+
}

src/components/PageTitle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PropsWithChildren } from "react";
2-
import { H2 } from "./H2";
2+
import { H2 } from "./Headings";
33

44
export function PageTitle({ children }: PropsWithChildren<unknown>) {
55
return (

src/pages/quotes/QuotesPage.tsx

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { Breadcrumbs } from "@/components/Breadcrumbs";
2+
import { H3 } from "@/components/Headings";
23
import { PageTitle } from "@/components/PageTitle";
4+
import { Button } from "@/components/ui/button";
35
import { Skeleton } from "@/components/ui/skeleton";
46
import { fetchAdminQuotePending } from "@/lib/api";
57
import { useSuspenseQuery } from "@tanstack/react-query";
8+
import { ViewIcon } from "lucide-react";
69
import { Suspense } from "react";
710

811

@@ -14,7 +17,7 @@ function Loader() {
1417
)
1518
}
1619

17-
function PageBody() {
20+
function QuoteListPendingRaw() {
1821
const { data } = useSuspenseQuery({
1922
queryKey: ["quotes-pending"],
2023
queryFn: fetchAdminQuotePending,
@@ -29,14 +32,46 @@ function PageBody() {
2932
)
3033
}
3134

35+
function QuoteListPending() {
36+
const { data } = useSuspenseQuery({
37+
queryKey: ["quotes-pending"],
38+
queryFn: fetchAdminQuotePending,
39+
});
40+
41+
return (
42+
<>
43+
<div className="flex flex-col gap-1">
44+
{data.quotes.map((it, index) => {
45+
return (<div key={index} className="flex gap-1 items-center text-sm">
46+
<span>{it}</span>
47+
<Button size="sm">
48+
<ViewIcon />
49+
</Button>
50+
</div>)
51+
})}
52+
</div>
53+
</>
54+
)
55+
}
56+
57+
function PageBody() {
58+
return (
59+
<>
60+
<H3>Pending</H3>
61+
<Suspense fallback={<Loader />}>
62+
<QuoteListPending />
63+
<QuoteListPendingRaw />
64+
</Suspense>
65+
</>
66+
)
67+
}
68+
3269
export default function QuotesPage() {
3370
return (
3471
<>
3572
<Breadcrumbs>Quotes</Breadcrumbs>
3673
<PageTitle>Quotes</PageTitle>
37-
<Suspense fallback={<Loader />}>
38-
<PageBody />
39-
</Suspense>
74+
<PageBody />
4075
</>
4176
)
4277
}

0 commit comments

Comments
 (0)