File size: 1,360 Bytes
2606dde
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
676f857
2606dde
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<script lang="ts">
	import CarbonEarth from "~icons/carbon/earth";
	import CarbonArrowUpRight from "~icons/carbon/arrow-up-right";
	import type { Model } from "$lib/types/Model";

	export let model: Pick<Model, "name" | "datasetName" | "websiteUrl">;

	export let variant: "light" | "dark" = "light";
</script>

<div
	class="flex items-center gap-5 rounded-xl bg-gray-100 px-3 py-2 text-sm 
	{variant === 'dark'
		? 'text-gray-600 dark:bg-gray-800 dark:text-gray-300'
		: 'text-gray-800 dark:bg-gray-100 dark:text-gray-600'}"
>
	<a
		href="https://huggingface.co/{model.name}"
		target="_blank"
		rel="noreferrer"
		class="flex items-center hover:underline"
		><CarbonArrowUpRight class="mr-1.5 shrink-0 text-xs text-gray-400" />
		Model
		<div class="max-sm:hidden">&nbsp;page</div></a
	>
	{#if model.datasetName}
		<a
			href="https://huggingface.co/datasets/{model.datasetName}"
			target="_blank"
			rel="noreferrer"
			class="flex items-center hover:underline"
			><CarbonArrowUpRight class="mr-1.5 shrink-0 text-xs text-gray-400" />
			Dataset
			<div class="max-sm:hidden">&nbsp;page</div></a
		>
	{/if}
	{#if model.websiteUrl}
		<a
			href={model.websiteUrl}
			target="_blank"
			class="ml-auto flex items-center hover:underline"
			rel="noreferrer"
		>
			<CarbonEarth class="mr-1.5 shrink-0 text-xs text-gray-400" />
			Website
		</a>
	{/if}
</div>