|
1 | 1 | @using Sidekick.Modules.Trade.Localization |
2 | 2 | @using Sidekick.Modules.Trade.Components.Prices |
3 | 3 |
|
4 | | -@if (TradeService.CurrentMode != TradeMode.Bulk) |
| 4 | +@if (TradeService.CurrentMode != TradeMode.Bulk || TradeService.BulkTradeResult == null) |
5 | 5 | { |
6 | 6 | return; |
7 | 7 | } |
8 | 8 |
|
9 | | -@if (TradeService.IsLoading) |
| 9 | +<div class="flex items-center w-full justify-between dark:bg-stone-900 sticky top-0 z-10 mb-3"> |
| 10 | + <div> |
| 11 | + <CountString Count="TradeService.BulkTradeResult.Offers.Count" |
| 12 | + Total="TradeService.BulkTradeResult.TotalOffers"/> |
| 13 | + </div> |
| 14 | + <OpenWebsiteLink QueryId="@TradeService.BulkTradeResult.QueryId"/> |
| 15 | +</div> |
| 16 | + |
| 17 | +@if (TradeService.ResultError != null) |
10 | 18 | { |
11 | | - <AppLoading/> |
| 19 | + <AlertError>@TradeService.ResultError</AlertError> |
12 | 20 | } |
13 | | -else if (TradeService.BulkTradeResult != null) |
14 | | -{ |
15 | | - <div class="flex items-center w-full justify-between dark:bg-stone-900 sticky top-0 z-10 mb-3"> |
16 | | - <div> |
17 | | - <CountString Count="TradeService.BulkTradeResult.Offers.Count" |
18 | | - Total="TradeService.BulkTradeResult.TotalOffers"/> |
19 | | - </div> |
20 | | - <OpenWebsiteLink QueryId="@TradeService.BulkTradeResult.QueryId"/> |
21 | | - </div> |
22 | 21 |
|
23 | | - @if (TradeService.ResultError != null) |
24 | | - { |
25 | | - <AlertError>@TradeService.ResultError</AlertError> |
26 | | - } |
| 22 | +@if (TradeService.BulkTradeResult.Offers.Count == 0) |
| 23 | +{ |
| 24 | + <AlertInfo>@Resources["NoResults"]</AlertInfo> |
| 25 | + return; |
| 26 | +} |
27 | 27 |
|
28 | | - @foreach (var offer in TradeService.BulkTradeResult.Offers) |
29 | | - { |
30 | | - <div class="mb-2 flex flex-nowrap items-center w-full bg-stone-950 rounded-lg"> |
31 | | - <div class="w-1/4 p-2 text-center"> |
32 | | - <TextBase Class="text-ellipsis overflow-hidden">@offer.AccountName</TextBase> |
33 | | - <TextAge Date="offer.Date"/> |
34 | | - </div> |
35 | | - <div class="w-5/12 p-2"> |
36 | | - <div class="flex items-center w-full justify-center"> |
37 | | - <PriceDisplay Value="offer.SaleAmount" Currency="@offer.SaleCurrency" Small="true"/> |
38 | | - <Icon Svg="@UiIcons.ArrowForward" Class="mx-1 text-[#a38d6d]" /> |
39 | | - <PriceDisplay Value="offer.ItemAmount" Currency="@offer.ItemCurrency" Small="true"/> |
40 | | - </div> |
41 | | - <TextBase Class="text-center"> |
42 | | - <span class="text-[#a38d6d]">@Resources["Stock"]:</span> |
43 | | - @offer.ItemStock |
44 | | - </TextBase> |
45 | | - </div> |
46 | | - <div class="w-1/3 p-2 flex justify-end items-center"> |
47 | | - <PriceDisplay Value="offer.SaleUnitPrice" Currency="@offer.SaleCurrency"/> |
| 28 | +@foreach (var offer in TradeService.BulkTradeResult.Offers) |
| 29 | +{ |
| 30 | + <div class="mb-2 flex flex-nowrap items-center w-full bg-stone-950 rounded-lg"> |
| 31 | + <div class="w-1/4 p-2 text-center"> |
| 32 | + <TextBase Class="text-ellipsis overflow-hidden">@offer.AccountName</TextBase> |
| 33 | + <TextAge Date="offer.Date"/> |
| 34 | + </div> |
| 35 | + <div class="w-5/12 p-2"> |
| 36 | + <div class="flex items-center w-full justify-center"> |
| 37 | + <PriceDisplay Value="offer.SaleAmount" Currency="@offer.SaleCurrency" Small="true"/> |
| 38 | + <Icon Svg="@UiIcons.ArrowForward" Class="mx-1 text-[#a38d6d]"/> |
| 39 | + <PriceDisplay Value="offer.ItemAmount" Currency="@offer.ItemCurrency" Small="true"/> |
48 | 40 | </div> |
| 41 | + <TextBase Class="text-center"> |
| 42 | + <span class="text-[#a38d6d]">@Resources["Stock"]:</span> |
| 43 | + @offer.ItemStock |
| 44 | + </TextBase> |
49 | 45 | </div> |
50 | | - } |
| 46 | + <div class="w-1/3 p-2 flex justify-end items-center"> |
| 47 | + <PriceDisplay Value="offer.SaleUnitPrice" Currency="@offer.SaleCurrency"/> |
| 48 | + </div> |
| 49 | + </div> |
| 50 | +} |
| 51 | + |
| 52 | +@if (TradeService.IsLoading) |
| 53 | +{ |
| 54 | + <AppLoading/> |
51 | 55 | } |
52 | 56 |
|
53 | 57 | @implements IDisposable |
|
0 commit comments