Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

1.4 KB
Raw Blame
import { useTranslation } from "react-i18next";
import { StatTile } from "@editor/ui";
import {
  DOCUMENT_STATUS_LABEL,
  type ReviewDocument,
} from "@processor/api/documents";
import { PrivateContent } from "@editor/components/shared/PrivateContent";

/** Key fields for the selected document - product, action, user, status. */
export function DocumentOverview({ doc }: { doc: ReviewDocument }) {
  const { t } = useTranslation();
  return (
    <div className="portal-documents__overview">
      <div className="portal-documents__stat-grid">
        <StatTile
          label={t("portal.documents.overview.status")}
          value={t(DOCUMENT_STATUS_LABEL[doc.status])}
        />
        <StatTile
          label={t("portal.documents.overview.product")}
          value={doc.product}
        />
        <StatTile
          label={t("portal.documents.overview.action")}
          value={
            doc.product === "Editor" || !doc.action
              ? t("portal.documents.table.editorAction")
              : doc.action
          }
        />
        <StatTile
          label={t("portal.documents.overview.user")}
          value={<PrivateContent>{doc.user || "-"}</PrivateContent>}
        />
        <StatTile
          label={t("portal.documents.overview.type")}
          value={doc.type}
        />
        <StatTile
          label={t("portal.documents.overview.received")}
          value={doc.time}
        />
      </div>
    </div>
  );
}