chore: improved ui for runner settings dropdown

This commit is contained in:
alina 🌸 2025-01-24 08:03:20 +03:00
parent 216d62d81e
commit 386213c171
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI

View file

@ -4,7 +4,7 @@ import type { Setter } from 'solid-js'
import type { CustomTypeScriptWorker } from '../editor/utils/custom-worker.ts' import type { CustomTypeScriptWorker } from '../editor/utils/custom-worker.ts'
import { timers } from '@fuman/utils' import { timers } from '@fuman/utils'
import { persistentAtom } from '@nanostores/persistent' import { persistentAtom } from '@nanostores/persistent'
import { LucideCheck, LucidePlay, LucidePlug, LucideRefreshCw, LucideSkull, LucideUnplug } from 'lucide-solid' import { LucideCheck, LucidePlay, LucidePlug, LucideRefreshCw, LucideSettings2, LucideSkull, LucideUnplug } from 'lucide-solid'
import { languages, Uri } from 'monaco-editor/esm/vs/editor/editor.api.js' import { languages, Uri } from 'monaco-editor/esm/vs/editor/editor.api.js'
import { createEffect, createSignal, on, onCleanup, onMount } from 'solid-js' import { createEffect, createSignal, on, onCleanup, onMount } from 'solid-js'
import { Dynamic } from 'solid-js/web' import { Dynamic } from 'solid-js/web'
@ -268,30 +268,34 @@ export function Runner(props: {
</Button> </Button>
)} )}
<div class="flex-1" /> <div class="flex-1" />
<div class="mr-2 flex items-center text-xs font-medium">
{{
offline: 'Disconnected',
connecting: 'Connecting...',
updating: 'Updating...',
connected: 'Ready',
}[connectionState()]}
<div class={cn(
'ml-2 size-2 rounded-full',
{
connected: 'bg-green-500',
updating: 'bg-yellow-500',
connecting: 'bg-yellow-500',
offline: 'bg-neutral-400',
}[connectionState()],
)}
/>
</div>
<DropdownMenu> <DropdownMenu>
<DropdownMenuTrigger <DropdownMenuTrigger
as={(props: DropdownMenuTriggerProps) => ( as={(props: DropdownMenuTriggerProps) => (
<Button <Button
variant="ghost" variant="ghost"
size="xs" size="icon"
class="size-7"
{...props} {...props}
> >
{{ <LucideSettings2 class="size-4" />
offline: 'Disconnected',
connecting: 'Connecting...',
updating: 'Updating...',
connected: 'Ready',
}[connectionState()]}
<div class={cn(
'ml-2 size-2 rounded-full',
{
connected: 'bg-green-500',
updating: 'bg-yellow-500',
connecting: 'bg-yellow-500',
offline: 'bg-neutral-400',
}[connectionState()],
)}
/>
</Button> </Button>
)} )}
/> />