1
1
import { Breadcrumbs } from "@/components/Breadcrumbs" ;
2
+ import { H3 } from "@/components/Headings" ;
2
3
import { PageTitle } from "@/components/PageTitle" ;
4
+ import { Button } from "@/components/ui/button" ;
3
5
import { Skeleton } from "@/components/ui/skeleton" ;
4
6
import { fetchAdminQuotePending } from "@/lib/api" ;
5
7
import { useSuspenseQuery } from "@tanstack/react-query" ;
8
+ import { ViewIcon } from "lucide-react" ;
6
9
import { Suspense } from "react" ;
7
10
8
11
@@ -14,7 +17,7 @@ function Loader() {
14
17
)
15
18
}
16
19
17
- function PageBody ( ) {
20
+ function QuoteListPendingRaw ( ) {
18
21
const { data } = useSuspenseQuery ( {
19
22
queryKey : [ "quotes-pending" ] ,
20
23
queryFn : fetchAdminQuotePending ,
@@ -29,14 +32,46 @@ function PageBody() {
29
32
)
30
33
}
31
34
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
+
32
69
export default function QuotesPage ( ) {
33
70
return (
34
71
< >
35
72
< Breadcrumbs > Quotes</ Breadcrumbs >
36
73
< PageTitle > Quotes</ PageTitle >
37
- < Suspense fallback = { < Loader /> } >
38
- < PageBody />
39
- </ Suspense >
74
+ < PageBody />
40
75
</ >
41
76
)
42
77
}
0 commit comments