~james/core

core/web/src/lib/components/profile/FollowerFollowing.svelte -rw-r--r-- 982 bytes
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 15 hours ago
                                                                                
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
<script lang="ts">
	import { resolve } from "$app/paths";
	import Users from "$icon/users";
	import Separator from "#lib/components/ui/Separator.svelte";
	import { formatCount, pluralize } from "#lib/format.ts";

	interface Props {
		actor: string;
		followers: number;
		following: number;
		class?: string;
	}

	let { actor, followers, following, class: className }: Props = $props();
</script>

<div
	class="my-xs flex max-w-full items-center gap-xs truncate typography-paragraph-small {className}"
>
	<span class="shrink-0"><Users class="size-3.5" aria-hidden="true" /></span>
	<span>
		<a href={resolve(`/${actor}?tab=followers` as "/")} class="no-underline hover:underline"
			>{pluralize(followers, "follower", "followers")}</a
		>
	</span>
	<span class="text-foreground-subtle"><Separator variant="dot" /></span>
	<span>
		<a href={resolve(`/${actor}?tab=following` as "/")} class="no-underline hover:underline"
			>{formatCount(following)} following</a
		>
	</span>
</div>