feat: Share modal

This commit is contained in:
Sidharth Vinod
2025-03-13 19:50:41 -07:00
parent 7abe8f82b1
commit 30cb61b966
12 changed files with 187 additions and 68 deletions
+10 -6
View File
@@ -1,6 +1,8 @@
<script lang="ts">
import * as Popover from '$/components/ui/popover';
import { Switch } from '$/components/ui/switch';
import { env } from '$/util/env';
import { urlsStore } from '$/util/state';
import { cn } from '$/utils';
import { mode, setMode } from 'mode-watcher';
import type { Component } from 'svelte';
@@ -62,12 +64,14 @@
checked={$mode === 'dark'}
onCheckedChange={(dark) => setMode(dark ? 'dark' : 'light')} />
</div>
{@render menuItem({
label: 'Edit in Playground',
icon: PlaygroundIcon,
href: '/',
class: 'text-accent bg-background hover:bg-background/50'
})}
{#if env.isEnabledMermaidChartLinks}
{@render menuItem({
label: 'Edit in Playground',
icon: PlaygroundIcon,
href: $urlsStore.mermaidChart.playground,
class: 'text-accent bg-background hover:bg-background/50'
})}
{/if}
</div>
</Popover.Content>
</Popover.Root>