Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Thomas G. Lopes
commited on
Commit
·
1641adc
1
Parent(s):
ca6038a
better stylings
Browse files
src/lib/components/billing-indicator.svelte
CHANGED
|
@@ -12,54 +12,26 @@
|
|
| 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="
|
| 26 |
{:else if billing.organization}
|
| 27 |
-
<IconGroup class="
|
| 28 |
{:else}
|
| 29 |
-
<IconUser class="
|
| 30 |
{/if}
|
| 31 |
|
| 32 |
-
|
| 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 |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
</div>
|
| 50 |
-
|
| 51 |
-
<span class="text-xs text-gray-500 dark:text-gray-400">
|
| 52 |
-
{#if billing.organization}
|
| 53 |
-
{#if billing.validating}
|
| 54 |
-
Validating organization...
|
| 55 |
-
{:else if billing.isValid}
|
| 56 |
-
Organization billing
|
| 57 |
-
{:else}
|
| 58 |
-
Organization not found
|
| 59 |
-
{/if}
|
| 60 |
-
{:else}
|
| 61 |
-
Personal billing
|
| 62 |
-
{/if}
|
| 63 |
-
</span>
|
| 64 |
-
</div>
|
| 65 |
</button>
|
|
|
|
| 12 |
const { showModal }: Props = $props();
|
| 13 |
</script>
|
| 14 |
|
| 15 |
+
<button onclick={showModal} class="btn-sm">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
<!-- Avatar or Icon -->
|
| 17 |
{#if billing.organization && billing.organizationInfo?.avatar && billing.isValid}
|
| 18 |
+
<img src={billing.organizationInfo.avatar} alt={billing.displayName} class="size-4 rounded-full" />
|
| 19 |
{:else if billing.organization}
|
| 20 |
+
<IconGroup class="size-4" />
|
| 21 |
{:else}
|
| 22 |
+
<IconUser class="size-4" />
|
| 23 |
{/if}
|
| 24 |
|
| 25 |
+
<span class="max-w-32 truncate">{billing.displayName}</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
<!-- Status indicator for organization -->
|
| 28 |
+
{#if billing.organization}
|
| 29 |
+
{#if billing.validating}
|
| 30 |
+
<div class="size-3 animate-spin rounded-full border border-yellow-600 border-t-transparent"></div>
|
| 31 |
+
{:else if billing.isValid}
|
| 32 |
+
<IconCheckmark class="size-3 text-green-600 dark:text-green-400" />
|
| 33 |
+
{:else}
|
| 34 |
+
<IconWarning class="size-3 text-red-600 dark:text-red-400" />
|
| 35 |
+
{/if}
|
| 36 |
+
{/if}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
</button>
|
src/lib/components/inference-playground/provider-select.svelte
CHANGED
|
@@ -34,6 +34,12 @@
|
|
| 34 |
onValueChange(v) {
|
| 35 |
conversation.update({ provider: v });
|
| 36 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
});
|
| 38 |
|
| 39 |
const nameMap: Record<string, string> = {
|
|
@@ -95,6 +101,12 @@
|
|
| 95 |
onValueChange(v) {
|
| 96 |
conversation.update({ autoPolicy: v });
|
| 97 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
});
|
| 99 |
|
| 100 |
// Shared button styles
|
|
|
|
| 34 |
onValueChange(v) {
|
| 35 |
conversation.update({ provider: v });
|
| 36 |
},
|
| 37 |
+
sameWidth: false,
|
| 38 |
+
floatingConfig: {
|
| 39 |
+
computePosition: {
|
| 40 |
+
placement: "bottom-start",
|
| 41 |
+
},
|
| 42 |
+
},
|
| 43 |
});
|
| 44 |
|
| 45 |
const nameMap: Record<string, string> = {
|
|
|
|
| 101 |
onValueChange(v) {
|
| 102 |
conversation.update({ autoPolicy: v });
|
| 103 |
},
|
| 104 |
+
sameWidth: false,
|
| 105 |
+
floatingConfig: {
|
| 106 |
+
computePosition: {
|
| 107 |
+
placement: "bottom-start",
|
| 108 |
+
},
|
| 109 |
+
},
|
| 110 |
});
|
| 111 |
|
| 112 |
// Shared button styles
|