aboutsummaryrefslogtreecommitdiff
path: root/lume/src/_components/XeblogSticker.tsx
blob: 8a4a7475b513e4f607769f9d64025ddc9a78ac49 (plain)
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
export interface XeblogStickerProps {
  name: string;
  mood: string;
  maxHeight?: string | null;
}

export default function XeblogSticker({
  name,
  mood,
  maxHeight = null,
}: XeblogStickerProps) {
  const nameLower = name.toLowerCase();
  name = name.replace(" ", "_");
  if (maxHeight === null) {
    maxHeight = "12rem";
  }

  return (
    <>
      <img
        style={`max-height:${maxHeight}`}
        alt={`${name} is ${mood}`}
        loading="lazy"
        src={`https://stickers.xeiaso.net/sticker/${nameLower}/${mood}`}
      />
    </>
  );
}