File size: 771 Bytes
c59fd93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<script lang="ts">
	import { MODALITY_ICONS, MODALITY_LABELS } from '$lib/constants';
	import { ModelModality } from '$lib/enums';

	interface Props {
		modalities: ModelModality[];
		class?: string;
	}

	let { class: className = '', modalities }: Props = $props();

	const shownModalities = [ModelModality.VISION, ModelModality.AUDIO, ModelModality.VIDEO] as const;

	let visible = $derived(shownModalities.filter((modality) => modalities.includes(modality)));
</script>

{#each visible as modality (modality)}
	{@const ModalityIcon = MODALITY_ICONS[modality]}
	<span
		class={[
			'inline-flex items-center gap-1 rounded-md bg-muted px-2 py-1 text-xs font-medium',
			className
		]}
	>
		<ModalityIcon class="h-3 w-3" />

		{MODALITY_LABELS[modality]}
	</span>
{/each}