import AutoSizer from "react-virtualized-auto-sizer"; import { FixedSizeList as List } from "react-window"; import { User } from "revolt.js/dist/maps/Users"; import styled from "styled-components"; import { Text } from "preact-i18n"; import { forwardRef } from "preact/compat"; import { UserButton } from "../items/ButtonItem"; export type MemberListEntry = string | User; interface ItemData { entries: MemberListEntry[]; } const PADDING_SIZE = 6; const ListCategory = styled.div` display: flex; padding: 14px; font-size: 0.8em; font-weight: 600; user-select: none; flex-direction: column; justify-content: flex-end; color: var(--secondary-foreground); `; const Row = ({ data, style, index, }: { data: ItemData; index: number; style: JSX.CSSProperties; }) => { const item = data.entries[index]; style.top = `${parseFloat(style.top as string) + PADDING_SIZE}px`; if (typeof item === "string") { const [cat, count] = item.split(":"); return (