Skip to content

Commit 05052aa

Browse files
authored
Merge pull request #2426 from appwrite/design-updates
2 parents 05befa8 + 91728ac commit 05052aa

File tree

1 file changed

+25
-31
lines changed
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/(suggestions)

1 file changed

+25
-31
lines changed

src/routes/(console)/project-[region]-[project]/databases/database-[database]/(suggestions)/input.svelte

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
<script lang="ts">
2+
import { onMount } from 'svelte';
3+
import { isCloud } from '$lib/system';
24
import IconAI from './icon/ai.svelte';
35
import { slide } from 'svelte/transition';
46
import { tableColumnSuggestions } from './store';
57
import { Button, InputTextarea } from '$lib/elements/forms';
6-
import { Card, Icon, Layout, Selector, Typography } from '@appwrite.io/pink-svelte';
7-
import { onMount } from 'svelte';
8-
import { isSmallViewport } from '$lib/stores/viewport';
9-
import { isCloud } from '$lib/system';
10-
import { IconExternalLink } from '@appwrite.io/pink-icons-svelte';
8+
import { Card, Layout, Selector, Typography } from '@appwrite.io/pink-svelte';
119
1210
onMount(() => {
1311
if (featureActive) {
@@ -17,51 +15,47 @@
1715
1816
const featureActive = $derived(isCloud);
1917
18+
const title = $derived.by(() => {
19+
return featureActive
20+
? 'Smart column suggestions'
21+
: 'Smart column suggestions available on Cloud';
22+
});
23+
2024
const subtitle = $derived.by(() => {
2125
return featureActive
2226
? 'Enable AI to suggest useful columns based on your table name'
23-
: 'AI suggestions are available on all Appwrite Cloud projects';
27+
: 'Sign up for Cloud to generate columns based on your table name';
2428
});
2529
</script>
2630

2731
<Card.Base variant="secondary" radius="s" padding="xs">
28-
<Layout.Stack gap="m">
29-
<Layout.Stack
30-
gap="s"
31-
direction="row"
32-
alignItems={$isSmallViewport ? 'flex-start' : 'center'}>
32+
<Layout.Stack gap={featureActive ? 'm' : 'l'}>
33+
<Layout.Stack gap="s" direction="row" alignItems="flex-start">
3334
<IconAI />
3435

3536
<Layout.Stack direction="column" gap="none">
36-
<Layout.Stack direction="row" justifyContent="space-between" alignItems="center">
37-
<Typography.Text variant="m-500" color="--fgcolor-neutral-primary"
38-
>Smart column suggestions</Typography.Text>
39-
40-
<div class="suggestions-switch">
41-
<Selector.Switch
42-
id="suggestions"
43-
label={undefined}
44-
disabled={!featureActive}
45-
bind:checked={$tableColumnSuggestions.enabled} />
46-
</div>
47-
</Layout.Stack>
37+
<Typography.Text variant="m-500" color="--fgcolor-neutral-primary"
38+
>{title}</Typography.Text>
4839

4940
<Typography.Text color="--fgcolor-neutral-secondary">
5041
{subtitle}
5142
</Typography.Text>
5243
</Layout.Stack>
44+
45+
{#if featureActive}
46+
<div class="suggestions-switch">
47+
<Selector.Switch
48+
id="suggestions"
49+
label={undefined}
50+
bind:checked={$tableColumnSuggestions.enabled} />
51+
</div>
52+
{/if}
5353
</Layout.Stack>
5454

5555
{#if !featureActive}
56-
<Layout.Stack inline alignItems="flex-end">
57-
<Button
58-
external
59-
secondary
60-
fullWidthMobile
61-
href="https://cloud.appwrite.io/register">
56+
<Layout.Stack>
57+
<Button external secondary href="https://cloud.appwrite.io/register">
6258
Sign up
63-
64-
<Icon icon={IconExternalLink} size="s" />
6559
</Button>
6660
</Layout.Stack>
6761
{/if}

0 commit comments

Comments
 (0)