|
10 | 10 | import { BillingPlan } from '$lib/constants';
|
11 | 11 | import { Click, trackEvent } from '$lib/actions/analytics';
|
12 | 12 | import {
|
13 |
| - Divider, |
14 | 13 | Typography,
|
15 | 14 | Expandable as ExpandableTable,
|
16 | 15 | Icon,
|
17 |
| - Layout |
| 16 | + Layout, |
| 17 | + Divider |
18 | 18 | } from '@appwrite.io/pink-svelte';
|
19 | 19 | import { humanFileSize } from '$lib/helpers/sizeConvertion';
|
20 | 20 | import { formatNum } from '$lib/helpers/string';
|
|
146 | 146 | id: 'base-plan',
|
147 | 147 | expandable: false,
|
148 | 148 | cells: {
|
149 |
| - item: 'Base plan', |
| 149 | + item: currentPlan?.price === 0 ? 'Free plan' : 'Base plan', |
150 | 150 | usage: '',
|
151 | 151 | price: formatCurrency(currentPlan?.price || 0)
|
152 | 152 | },
|
|
286 | 286 | {
|
287 | 287 | id: `project-${project.projectId}-usage-details`,
|
288 | 288 | cells: {
|
289 |
| - item: `<a href="${base}/project-${project.region}-${project.projectId}/settings/usage" style="text-decoration: underline; color: var(--fgcolor-accent-neutral);">Usage details</a>`, |
| 289 | + item: `<a href="/console/project-${String(project.region || 'default')}-${project.projectId}/settings/usage" style="text-decoration: underline; color: var(--fgcolor-accent-neutral);">Usage details</a>`, |
290 | 290 | usage: '',
|
291 | 291 | price: ''
|
292 | 292 | }
|
293 | 293 | }
|
294 | 294 | ]
|
295 | 295 | }));
|
296 |
| - const noProjects = |
297 |
| - projectsList && projectsList.length === 0 |
298 |
| - ? [ |
299 |
| - { |
300 |
| - id: 'no-projects', |
301 |
| - expandable: false, |
302 |
| - cells: { |
303 |
| - item: 'No projects found', |
304 |
| - usage: '', |
305 |
| - price: formatCurrency(0) |
306 |
| - }, |
307 |
| - children: [] |
308 |
| - } |
309 |
| - ] |
310 |
| - : []; |
| 296 | + const noProjects = []; |
311 | 297 | return [base, ...addons, ...projects, ...noProjects];
|
312 | 298 | }
|
313 | 299 |
|
|
321 | 307 |
|
322 | 308 | {#if $organization}
|
323 | 309 | <EstimatedCard>
|
324 |
| - <Typography.Title size="s">{currentPlan.name} plan</Typography.Title> |
325 |
| - |
326 |
| - <Typography.Text color="--fgcolor-neutral-primary"> |
327 |
| - Next payment of <span class="text u-bold">{formatCurrency(totalAmount)}</span> |
328 |
| - will occur on |
329 |
| - <span class="text u-bold">{toLocaleDate($organization?.billingNextInvoiceDate)}</span>. |
330 |
| - </Typography.Text> |
331 |
| - |
| 310 | + <Typography.Title size="s" gap="s">{currentPlan.name} plan</Typography.Title> |
| 311 | + |
| 312 | + {#if currentPlan?.price > 0} |
| 313 | + <Typography.Text color="--fgcolor-neutral-secondary"> |
| 314 | + Next payment of <span class="text --fgcolor-neutral-primary u-bold" |
| 315 | + >{formatCurrency(totalAmount)}</span> |
| 316 | + will occur on |
| 317 | + <span class="text --fgcolor-neutral-primary u-bold" |
| 318 | + >{toLocaleDate($organization?.billingNextInvoiceDate)}</span |
| 319 | + >. |
| 320 | + </Typography.Text> |
| 321 | + {/if} |
332 | 322 | <Divider />
|
333 | 323 | <div class="billing-cycle-header">
|
334 |
| - <Typography.Text color="--fgcolor-neutral-primary" variant="m-500"> |
| 324 | + <Typography.Text color="--fgcolor-neutral-secondary" variant="m-500"> |
335 | 325 | Current billing cycle ({new Date(
|
336 | 326 | $organization?.billingCurrentInvoiceDate
|
337 | 327 | ).toLocaleDateString('en', { day: 'numeric', month: 'short' })}-{new Date(
|
|
575 | 565 | display: flex;
|
576 | 566 | justify-content: space-between;
|
577 | 567 | align-items: flex-start;
|
578 |
| - margin-bottom: 0.5rem; |
579 |
| - margin-top: 1rem; |
580 | 568 | }
|
581 | 569 |
|
582 | 570 | :global(.card-only-on-desktop) {
|
|
0 commit comments