dynamic promo widget data

This commit is contained in:
SPRINX0\prochazka
2025-10-20 14:00:59 +02:00
parent 5bdf072cdf
commit 966eb01f1c

View File

@@ -1,59 +1,15 @@
<script lang='ts'>
<script lang="ts">
import JsonUiContentRenderer from '../jsonui/JsonUiContentRenderer.svelte';
import { JsonUiBlock } from '../jsonui/jsonuitypes';
import { usePromoWidget } from '../utility/metadataLoaders';
import WidgetsInnerContainer from './WidgetsInnerContainer.svelte';
const data: JsonUiBlock[] = [
{ type: 'heading', text: 'Try DbGate Premium' },
{ type: 'text', text: 'Upgrade to get exclusive features:' },
{
type: 'ticklist',
items: [
'Query designer',
'AI powered database chat',
'Unlimited DbGate Cloud storage',
'Shared cloud folders',
'Charts from query result',
'Compare database models',
'Synchronize database structure',
'Backup & restore database',
'Advanced ER diagram settings',
'Export database model',
'Firestore, libSQL, Turso, CosmosDB, Redshift support',
'Amazon and Azure identity providers',
'E-mail support',
],
},
{ type: 'heading', text: 'Download DbGate Premium' },
{
type: 'ticklist',
items: ['Free 30 day trial', 'DbGate Premium will reuse your connections and files from DbGate Community'],
},
{ type: 'button', text: 'Download', link: 'https://www.dbgate.io/download' },
{ type: 'heading', text: 'Purchase DbGate Premium' },
{
type: 'ticklist',
items: ['Use monthly or yearly subscription'],
},
{ type: 'button', text: 'Purchase', link: 'https://www.dbgate.io/purchase/premium' },
{ type: 'heading', text: 'Get PREMIUM license for free' },
{
type: 'text',
text: 'Your feedback is very valuable for us. We have time-limited offers available for users who provide feedback.',
},
{
type: 'button',
text: 'View current offer',
link: 'https://www.dbgate.io/review?utm_campaign=communityWidget',
},
];
const promoWidget = usePromoWidget({});
</script>
<WidgetsInnerContainer>
<JsonUiContentRenderer blocks={data} />
{#if $promoWidget?.state == 'data'}
<JsonUiContentRenderer blocks={$promoWidget?.blocks} />
{/if}
</WidgetsInnerContainer>
<style>