aboutsummaryrefslogtreecommitdiff
path: root/lume/src/_components/XeblogConv.tsx
blob: 95f26fc69cfa2d8808c0cfe8cf662ff36abce38a (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
29
30
31
32
33
34
35
36
export interface XeblogConvProps {
  name: string;
  mood: string;
  children: HTMLElement[];
  standalone?: boolean;
}

const ConvSnippet = ({ name, mood, children, standalone }: XeblogConvProps) => {
  const nameLower = name.toLowerCase();
  name = name.replace(" ", "_");
  const size = standalone ? 128 : 64;

  return (
    <>
      <div className="my-4 flex space-x-4 rounded-md border border-solid border-fg-4 bg-bg-2 p-3 dark:border-fgDark-4 dark:bg-bgDark-2 max-w-full min-h-fit">
        <div className="flex max-h-16 shrink-0 items-center justify-center self-center">
            <img
              style="max-height:6rem"
              alt={`${name} is ${mood}`}
              loading="lazy"
              src={`https://cdn.xeiaso.net/sticker/${nameLower}/${mood}/${size}`}
            />
        </div>
        <div className="convsnippet min-w-0 self-center">
          {"<"}
          <a href={`/characters#${nameLower}`}>
            <b>{name}</b>
          </a>
          {">"} {children}
        </div>
      </div>
    </>
  );
};

export default ConvSnippet;