open-webui/src/lib/components/app/AppSidebar.svelte

66 lines
1.7 KiB
Svelte
Raw Normal View History

2025-01-14 03:18:32 +00:00
<script lang="ts">
import Tooltip from '$lib/components/common/Tooltip.svelte';
import Plus from '$lib/components/icons/Plus.svelte';
2025-01-14 03:47:24 +00:00
let selected = '';
2025-01-14 03:18:32 +00:00
</script>
2025-01-19 19:48:05 +00:00
<div class="min-w-[4.5rem] bg-gray-50 dark:bg-gray-950 flex gap-2.5 flex-col pt-8">
2025-01-14 03:18:32 +00:00
<div class="flex justify-center relative">
{#if selected === 'home'}
<div class="absolute top-0 left-0 flex h-full">
2025-01-19 01:50:03 +00:00
<div class="my-auto rounded-r-lg w-1 h-8 bg-black dark:bg-white"></div>
2025-01-14 03:18:32 +00:00
</div>
{/if}
<Tooltip content="Home" placement="right">
<button
2025-01-15 07:53:19 +00:00
class=" cursor-pointer {selected === 'home' ? 'rounded-2xl' : 'rounded-full'}"
2025-01-14 03:18:32 +00:00
on:click={() => {
selected = 'home';
2025-01-19 19:48:05 +00:00
if (window.electronAPI) {
window.electronAPI.load('home');
}
2025-01-14 03:18:32 +00:00
}}
>
<img
src="/static/splash.png"
2025-01-19 19:48:05 +00:00
class="size-11 dark:invert p-0.5"
2025-01-14 03:18:32 +00:00
alt="logo"
draggable="false"
/>
</button>
</Tooltip>
</div>
2025-01-19 19:48:05 +00:00
<div class=" -mt-1 border-[1.5px] border-gray-100 dark:border-gray-900 mx-4"></div>
2025-01-14 03:18:32 +00:00
<div class="flex justify-center relative group">
{#if selected === ''}
<div class="absolute top-0 left-0 flex h-full">
2025-01-19 01:50:03 +00:00
<div class="my-auto rounded-r-lg w-1 h-8 bg-black dark:bg-white"></div>
2025-01-14 03:18:32 +00:00
</div>
{/if}
<button
class=" cursor-pointer bg-transparent"
2025-01-15 07:53:19 +00:00
on:click={() => {
2025-01-14 03:18:32 +00:00
selected = '';
}}
>
<img
2025-01-15 07:53:19 +00:00
src="/static/favicon.png"
class="size-10 {selected === '' ? 'rounded-2xl' : 'rounded-full'}"
2025-01-14 03:18:32 +00:00
alt="logo"
draggable="false"
/>
</button>
</div>
2025-01-19 01:50:03 +00:00
<!-- <div class="flex justify-center relative group text-gray-400">
2025-01-15 07:53:19 +00:00
<button class=" cursor-pointer p-2" on:click={() => {}}>
<Plus className="size-4" strokeWidth="2" />
2025-01-14 03:18:32 +00:00
</button>
2025-01-19 01:50:03 +00:00
</div> -->
2025-01-14 03:18:32 +00:00
</div>