grain.social is a photo sharing platform built on atproto.
1import { ProfileView } from "$lexicon/types/social/grain/actor/defs.ts";
2import { Un$Typed } from "$lexicon/util.ts";
3import { cn } from "@bigmoves/bff/components";
4import { DefaultLabelerAvatar } from "./DefaultLabelerAvatar.tsx";
5
6export function LabelerAvatar({
7 profile,
8 size,
9 class: classProp,
10}: Readonly<
11 { profile: Un$Typed<ProfileView>; size?: number; class?: string }
12>) {
13 return (
14 profile.avatar
15 ? (
16 <img
17 src={profile.avatar}
18 alt={profile.handle}
19 title={profile.handle}
20 class={cn("rounded-full object-cover", classProp)}
21 style={size ? { width: size, height: size } : undefined}
22 />
23 )
24 : <DefaultLabelerAvatar size={size} class={classProp} />
25 );
26}