open-webui/src/lib/components/common/Emoji.svelte
Timothy Jaeryang Baek b70c0f36c0 enh: emoji folder icon
2025-09-04 02:50:50 +04:00

20 lines
414 B
Svelte

<script>
import { WEBUI_BASE_URL } from '$lib/constants';
import { shortCodesToEmojis } from '$lib/stores';
export let shortCode;
export let className = 'size-4';
</script>
{#if $shortCodesToEmojis[shortCode]}
<img
src="{WEBUI_BASE_URL}/assets/emojis/{$shortCodesToEmojis[shortCode].toLowerCase()}.svg"
alt={shortCode}
class={className}
loading="lazy"
/>
{:else}
<div>
{shortCode}
</div>
{/if}