50 lines
1.5 KiB
TypeScript
50 lines
1.5 KiB
TypeScript
// The forum's own reaction marks (no emoji): a heart, a lotus, two circles
|
|||
|
|
// meeting, a star. Each has its colour (forum.css: .ri-<kind>); the viewer's
|
||
|
|
// own reaction is drawn filled.
|
||
|
|
import type { ReactionKind } from "@/lib/forum";
|
||
|
|
|
||
|
|
export function ReactionIcon({
|
||
|
|
kind,
|
||
|
|
size = 16,
|
||
|
|
filled = false,
|
||
|
|
}: {
|
||
|
|
kind: ReactionKind;
|
||
|
|
size?: number;
|
||
|
|
filled?: boolean;
|
||
|
|
}) {
|
||
|
|
return (
|
||
|
|
<svg
|
||
|
|
viewBox="0 0 24 24"
|
||
|
|
width={size}
|
||
|
|
height={size}
|
||
|
|
aria-hidden="true"
|
||
|
|
className={filled ? `ri ri-${kind} ri-filled` : `ri ri-${kind}`}
|
||
|
|
>
|
||
|
|
{kind === "with_you" && (
|
||
|
|
<path d="M12 20s-7.5-4.6-7.5-10.2A4.2 4.2 0 0 1 12 7.3a4.2 4.2 0 0 1 7.5 2.5C19.5 15.4 12 20 12 20z" />
|
||
|
|
)}
|
||
|
|
{kind === "thanks" && (
|
||
|
|
<>
|
||
|
|
<path d="M12 4.5c2.3 2.7 2.3 6.6 0 9.3c-2.3-2.7-2.3-6.6 0-9.3z" />
|
||
|
|
<path d="M12 13.8c-3.2-.5-5.9-2.6-6.8-6.1c3.2.2 5.6 2.4 6.8 6.1z" />
|
||
|
|
<path d="M12 13.8c3.2-.5 5.9-2.6 6.8-6.1c-3.2.2-5.6 2.4-6.8 6.1z" />
|
||
|
|
<path d="M5.5 17.5h13" className="ri-line" />
|
||
|
|
<path d="M8.5 20.2h7" className="ri-line" />
|
||
|
|
</>
|
||
|
|
)}
|
||
|
|
{kind === "me_too" && (
|
||
|
|
<>
|
||
|
|
<circle cx="9.3" cy="12" r="5.3" />
|
||
|
|
<circle cx="14.7" cy="12" r="5.3" />
|
||
|
|
</>
|
||
|
|
)}
|
||
|
|
{kind === "insight" && (
|
||
|
|
<>
|
||
|
|
<path d="M11 4l1.7 5.1 5.1 1.7-5.1 1.7L11 17.6l-1.7-5.1-5.1-1.7 5.1-1.7z" />
|
||
|
|
<path d="M18 15.5l.6 1.6 1.6.6-1.6.6-.6 1.6-.6-1.6-1.6-.6 1.6-.6z" />
|
||
|
|
</>
|
||
|
|
)}
|
||
|
|
</svg>
|
||
|
|
);
|
||
|
|
}
|