open-webui/src/lib/components/chat/Messages/ResponseMessage/FollowUps.svelte

39 lines
1.1 KiB
Svelte
Raw Normal View History

2025-06-03 14:47:49 +00:00
<script lang="ts">
2025-06-03 17:51:12 +00:00
import ArrowTurnDownRight from '$lib/components/icons/ArrowTurnDownRight.svelte';
2025-06-03 14:47:49 +00:00
import { onMount, tick, getContext } from 'svelte';
const i18n = getContext('i18n');
export let followUps: string[] = [];
export let onClick: (followUp: string) => void = () => {};
</script>
2025-06-03 17:51:12 +00:00
<div class="mt-4">
<div class="text-sm font-medium">
2025-06-03 14:47:49 +00:00
{$i18n.t('Follow up')}
</div>
<div class="flex flex-col text-left gap-1 mt-1.5">
{#each followUps as followUp, idx (idx)}
2025-06-16 12:33:48 +00:00
<!-- svelte-ignore a11y-no-static-element-interactions -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class=" mr-2 py-1.5 bg-transparent text-left text-sm flex items-center gap-2 px-1.5 text-gray-500 dark:text-gray-400 hover:text-black dark:hover:text-white transition cursor-pointer"
2025-06-03 14:47:49 +00:00
on:click={() => onClick(followUp)}
title={followUp}
aria-label={followUp}
>
2025-06-03 17:51:12 +00:00
<ArrowTurnDownRight className="size-3.5" />
<div class="line-clamp-1">
{followUp}
</div>
2025-06-16 12:33:48 +00:00
</div>
2025-06-03 17:51:12 +00:00
{#if idx < followUps.length - 1}
<hr class="border-gray-100 dark:border-gray-850" />
{/if}
2025-06-03 14:47:49 +00:00
{/each}
</div>
</div>