|
58 | 58 | </script>
|
59 | 59 |
|
60 | 60 | <script lang="ts">
|
61 |
| - import { Container } from '$lib/layout'; |
| 61 | + import { page } from '$app/stores'; |
62 | 62 | import { BarChart } from '$lib/charts';
|
| 63 | + import { Card, Heading, SecondaryTabs, SecondaryTabsItem } from '$lib/components'; |
63 | 64 | import { formatNumberWithCommas } from '$lib/helpers/numbers';
|
64 |
| - import { Card, SecondaryTabs, SecondaryTabsItem, Heading } from '$lib/components'; |
| 65 | + import { Container } from '$lib/layout'; |
65 | 66 | import { ProjectUsageRange, type Models } from '@appwrite.io/console';
|
66 |
| - import { page } from '$app/stores'; |
67 | 67 |
|
68 | 68 | type MetricMetadata = {
|
69 | 69 | title: string;
|
|
75 | 75 | export let count: Models.Metric[];
|
76 | 76 | export let countMetadata: MetricMetadata;
|
77 | 77 | export let path: string = null;
|
| 78 | + export let hideSelectPeriod: boolean = false; |
78 | 79 | </script>
|
79 | 80 |
|
80 | 81 | <Container>
|
81 | 82 | <div class="u-flex u-main-space-between common-section">
|
82 | 83 | <Heading tag="h2" size="5">{title}</Heading>
|
83 |
| - <SecondaryTabs> |
84 |
| - <SecondaryTabsItem href={`${path}/24h`} disabled={$page.params.period === '24h'}> |
85 |
| - 24h |
86 |
| - </SecondaryTabsItem> |
87 |
| - <SecondaryTabsItem |
88 |
| - href={`${path}/30d`} |
89 |
| - disabled={!$page.params.period || $page.params.period === '30d'}> |
90 |
| - 30d |
91 |
| - </SecondaryTabsItem> |
92 |
| - <SecondaryTabsItem href={`${path}/90d`} disabled={$page.params.period === '90d'}> |
93 |
| - 90d |
94 |
| - </SecondaryTabsItem> |
95 |
| - </SecondaryTabs> |
| 84 | + {#if !hideSelectPeriod} |
| 85 | + <SecondaryTabs> |
| 86 | + <SecondaryTabsItem href={`${path}/24h`} disabled={$page.params.period === '24h'}> |
| 87 | + 24h |
| 88 | + </SecondaryTabsItem> |
| 89 | + <SecondaryTabsItem |
| 90 | + href={`${path}/30d`} |
| 91 | + disabled={!$page.params.period || $page.params.period === '30d'}> |
| 92 | + 30d |
| 93 | + </SecondaryTabsItem> |
| 94 | + <SecondaryTabsItem href={`${path}/90d`} disabled={$page.params.period === '90d'}> |
| 95 | + 90d |
| 96 | + </SecondaryTabsItem> |
| 97 | + </SecondaryTabs> |
| 98 | + {/if} |
96 | 99 | </div>
|
97 | 100 | <Card>
|
98 | 101 | {#if count}
|
|
0 commit comments