Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Thomas G. Lopes
commited on
org billing (#94)
Browse files
src/lib/components/billing-indicator.svelte
CHANGED
@@ -10,39 +10,29 @@
|
|
10 |
}
|
11 |
|
12 |
const { showModal }: Props = $props();
|
13 |
-
|
14 |
-
const statusColor = $derived(() => {
|
15 |
-
if (!billing.organization) return "text-gray-600 dark:text-gray-400";
|
16 |
-
if (billing.validating) return "text-yellow-600 dark:text-yellow-400";
|
17 |
-
if (billing.isValid) return "text-green-600 dark:text-green-400";
|
18 |
-
return "text-red-600 dark:text-red-400";
|
19 |
-
});
|
20 |
-
|
21 |
-
const bgColor = $derived(() => {
|
22 |
-
if (!billing.organization) return "bg-gray-50 dark:bg-gray-800";
|
23 |
-
if (billing.validating) return "bg-yellow-50 dark:bg-yellow-900/20";
|
24 |
-
if (billing.isValid) return "bg-green-50 dark:bg-green-900/20";
|
25 |
-
return "bg-red-50 dark:bg-red-900/20";
|
26 |
-
});
|
27 |
</script>
|
28 |
|
29 |
<button
|
30 |
onclick={showModal}
|
31 |
-
class=
|
|
|
|
|
|
|
|
|
32 |
>
|
33 |
<!-- Avatar or Icon -->
|
34 |
{#if billing.organization && billing.organizationInfo?.avatar && billing.isValid}
|
35 |
<img src={billing.organizationInfo.avatar} alt={billing.displayName} class="h-5 w-5 rounded-full" />
|
36 |
{:else if billing.organization}
|
37 |
-
<IconGroup class="h-4 w-4
|
38 |
{:else}
|
39 |
-
<IconUser class="h-4 w-4
|
40 |
{/if}
|
41 |
|
42 |
<!-- Billing info -->
|
43 |
<div class="flex flex-col items-start">
|
44 |
-
<div class="flex items-center gap-1">
|
45 |
-
<span class="font-medium
|
46 |
{billing.displayName}
|
47 |
</span>
|
48 |
|
|
|
10 |
}
|
11 |
|
12 |
const { showModal }: Props = $props();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
</script>
|
14 |
|
15 |
<button
|
16 |
onclick={showModal}
|
17 |
+
class={[
|
18 |
+
"flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm transition-colors",
|
19 |
+
"bg-gray-100/50 hover:bg-gray-100 active:bg-gray-200",
|
20 |
+
"dark:bg-gray-800/70 dark:hover:bg-gray-700 dark:active:bg-gray-700/50",
|
21 |
+
]}
|
22 |
>
|
23 |
<!-- Avatar or Icon -->
|
24 |
{#if billing.organization && billing.organizationInfo?.avatar && billing.isValid}
|
25 |
<img src={billing.organizationInfo.avatar} alt={billing.displayName} class="h-5 w-5 rounded-full" />
|
26 |
{:else if billing.organization}
|
27 |
+
<IconGroup class="h-4 w-4" />
|
28 |
{:else}
|
29 |
+
<IconUser class="h-4 w-4" />
|
30 |
{/if}
|
31 |
|
32 |
<!-- Billing info -->
|
33 |
<div class="flex flex-col items-start">
|
34 |
+
<div class="flex items-center gap-1.5">
|
35 |
+
<span class="font-medium">
|
36 |
{billing.displayName}
|
37 |
</span>
|
38 |
|