11import { Breadcrumbs } from "@/components/Breadcrumbs" ;
2+ import { H3 } from "@/components/Headings" ;
23import { PageTitle } from "@/components/PageTitle" ;
4+ import { Button } from "@/components/ui/button" ;
35import { Skeleton } from "@/components/ui/skeleton" ;
46import { fetchAdminQuotePending } from "@/lib/api" ;
57import { useSuspenseQuery } from "@tanstack/react-query" ;
8+ import { ViewIcon } from "lucide-react" ;
69import { 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+
3269export 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