Newer
Older
taehui / qwilight-fe / src / etc / TotalEdgesView.tsx
@Taehui Taehui on 16 Mar 608 bytes 2024-03-17 오전 2:07
import EdgeItem from "@/etc/EdgeItem";
import { EtcAPIEdge } from "@/wwwAPI";
import { useTranslations } from "next-intl";
import { Badge, ListGroup } from "reactstrap";
import { sprintf } from "sprintf-js";

export default function TotalEdgesView({
  totalEdges,
}: {
  totalEdges: EtcAPIEdge[];
}) {
  const t = useTranslations();

  return (
    <ListGroup>
      <Badge>{t("etcTotalEdges")}</Badge>
      {totalEdges.map(({ edge, value }) => (
        <EdgeItem
          key={edge}
          edge={edge}
          text={sprintf(t("avatarCountText"), value)}
        />
      ))}
    </ListGroup>
  );
}