-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
704 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './api' | ||
export * from './model' |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ui' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { queryKeysFactory } from '@/shared/lib' | ||
import { useQuery } from '@tanstack/react-query' | ||
|
||
const ORDER_QUERY_KEY = 'order' | ||
export const orderQueryKeys = queryKeysFactory(ORDER_QUERY_KEY) | ||
|
||
export const useOrders = () => { | ||
const { data, ...other } = useQuery({ | ||
queryKey: orderQueryKeys.details(), | ||
queryFn: () => vendorGetOrd().then((res) => res.data), | ||
retry: false | ||
}) | ||
|
||
return { ...data, ...other } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './order-table' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { | ||
Table, | ||
TableBody, | ||
TableCell, | ||
TableHead, | ||
TableHeader, | ||
TableRow | ||
} from '@/shared/ui' | ||
|
||
const orders = [ | ||
{ | ||
display_id: 123, | ||
customer: 'John Doe', | ||
products: ['Product 1', 'Product 2', 'Product 3'], | ||
status: 'active', | ||
date: new Date(), | ||
revenue: 250 | ||
}, | ||
{ | ||
display_id: 123, | ||
customer: 'John Doe', | ||
products: ['Product 1', 'Product 2', 'Product 3'], | ||
status: 'active', | ||
date: new Date(), | ||
revenue: 250 | ||
}, | ||
{ | ||
display_id: 123, | ||
customer: 'John Doe', | ||
products: ['Product 1', 'Product 2', 'Product 3'], | ||
status: 'active', | ||
date: new Date(), | ||
revenue: 250 | ||
}, | ||
{ | ||
display_id: 123, | ||
customer: 'John Doe', | ||
products: ['Product 1', 'Product 2', 'Product 3'], | ||
status: 'active', | ||
date: new Date(), | ||
revenue: 250 | ||
} | ||
] | ||
|
||
export const OrderTable = () => { | ||
return ( | ||
<Table> | ||
<TableHeader> | ||
<TableRow> | ||
<TableHead className="w-[100px]">#</TableHead> | ||
<TableHead>Customer</TableHead> | ||
<TableHead>Products</TableHead> | ||
<TableHead>Status</TableHead> | ||
<TableHead>Date</TableHead> | ||
<TableHead className="text-right">Revenue</TableHead> | ||
</TableRow> | ||
</TableHeader> | ||
<TableBody> | ||
{orders.map((order) => ( | ||
<TableRow key={order.display_id}> | ||
<TableCell className="font-medium">{order.display_id}</TableCell> | ||
<TableCell>{order.customer}</TableCell> | ||
<TableCell>{order.products.join(', ')}</TableCell> | ||
<TableCell>{order.status}</TableCell> | ||
<TableCell>{order.date.toLocaleDateString()}</TableCell> | ||
<TableCell className="text-right">{order.revenue}</TableCell> | ||
</TableRow> | ||
))} | ||
</TableBody> | ||
</Table> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './api' | ||
export * from './model' |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ui.async' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { lazy } from 'react' | ||
|
||
export const OrdersPageAsync = lazy(() => import('./ui')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { OrderTable } from '@/entities/order' | ||
import { Text } from '@/shared/ui' | ||
|
||
export default function OrdersPage() { | ||
return ( | ||
<> | ||
<Text size="2xlarge" weight="plus"> | ||
Orders | ||
</Text> | ||
<OrderTable /> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.