import { Fragment } from "react"; import { Img } from "./Img"; import { Markdawn } from "./Markdown/Markdawn"; import { ToolTip } from "./ToolTip"; import { Chip } from "components/Chip"; import { RecorderChipFragment } from "graphql/generated"; import { ImageQuality } from "helpers/img"; import { filterHasAttributes } from "helpers/asserts"; import { atoms } from "contexts/atoms"; import { useAtomGetter } from "helpers/atoms"; /* * ╭─────────────╮ * ───────────────────────────────────────╯ COMPONENT ╰─────────────────────────────────────────── */ interface Props { className?: string; recorder: RecorderChipFragment; } // ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ export const RecorderChip = ({ recorder }: Props): JSX.Element => { const langui = useAtomGetter(atoms.localData.langui); return (
{recorder.avatar?.data?.attributes && ( )}

{recorder.username}

{recorder.languages?.data && recorder.languages.data.length > 0 && (

{langui.languages}:

{filterHasAttributes(recorder.languages.data, ["attributes"] as const).map( (language) => ( ) )}
)} {recorder.pronouns && (

{langui.pronouns}:

)}
{recorder.bio?.[0] && } } placement="top">
); };