Newer
Older
taehui / qwilight-fe / src / etc / TotalNoteFilesView.tsx
@Taehui Taehui on 16 Mar 857 bytes 2024-03-17 오전 1:28
import { Badge, ListGroup } from "reactstrap";
import { sprintf } from "sprintf-js";

import NoteItem from "@/note/NoteItem";
import { EtcAPINoteFile } from "@/wwwAPI";
import { useTranslations } from "next-intl";

export default function TotalNoteFilesView({
  totalNoteFiles,
}: {
  totalNoteFiles: EtcAPINoteFile[];
}) {
  const t = useTranslations();

  return (
    <ListGroup>
      <Badge>{t("etcTotalNoteFiles")}</Badge>
      {totalNoteFiles.map(
        ({ noteID, artist, title, genre, levelText, level, value }) => (
          <NoteItem
            key={noteID}
            noteID={noteID}
            artist={artist}
            title={title}
            genre={genre}
            levelText={levelText}
            level={level}
            fittedText={sprintf(t("textHandled"), value)}
          />
        ),
      )}
    </ListGroup>
  );
}