grain.social is a photo sharing platform built on atproto.
1import { AtUri } from "@atproto/syntax";
2
3export function AltTextButton({ photoUri }: Readonly<{ photoUri: string }>) {
4 return (
5 <button
6 type="button"
7 class="bg-zinc-950/50 dark:bg-zinc-950/50 py-[1px] px-[3px] absolute top-2 left-2 cursor-pointer flex items-center justify-center text-xs text-white font-semibold z-10"
8 hx-get={`/dialogs/photo/${new AtUri(photoUri).rkey}/alt`}
9 hx-trigger="click"
10 hx-target="#layout"
11 hx-swap="afterbegin"
12 _="on click halt"
13 >
14 <i class="fas fa-plus text-[10px] mr-1"></i> ALT
15 </button>
16 );
17}