aboutsummaryrefslogtreecommitdiff
path: root/lume/src/_components/XeblogConv.tsx
blob: 5d783b95eff68061acb0aff05f72229977951fb4 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
export interface XeblogConvProps {
  name: string;
  mood: string;
  children: HTMLElement[];
  standalone?: boolean;
  aiModel?: string;
}

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

  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:${standalone ? "6" : "4"}rem`}
            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}
          {aiModel && (
            <>
              <br />
              <small>Content generated by AI using the model {aiModel}.</small>
            </>
          )}
        </div>
      </div>
    </>
  );
};

export default ConvSnippet;