mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 00:15:44 +01:00
refactor
This commit is contained in:
@@ -24,10 +24,10 @@
|
||||
import React, { FC } from "react";
|
||||
import { Icon, Tooltip } from "@scm-manager/ui-components";
|
||||
import { useTranslation } from "react-i18next";
|
||||
//import { Signature } from "@scm-manager/ui-types";
|
||||
import { Signature } from "@scm-manager/ui-types";
|
||||
|
||||
type Props = {
|
||||
signatures: any[];
|
||||
signatures: Signature[];
|
||||
className: any;
|
||||
};
|
||||
|
||||
@@ -36,6 +36,10 @@ const SignatureIcon: FC<Props> = ({ signatures, className }) => {
|
||||
|
||||
const signature = signatures?.length > 0 ? signatures[0] : undefined;
|
||||
|
||||
if (!signature) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const createTooltipMessage = () => {
|
||||
let status;
|
||||
if (signature.status === "VERIFIED") {
|
||||
@@ -50,7 +54,7 @@ const SignatureIcon: FC<Props> = ({ signatures, className }) => {
|
||||
return `${t("changeset.signatureStatus")}: ${status}`;
|
||||
}
|
||||
|
||||
let message = `${t("changeset.signedBy")}: ${signature.owner}\n${t("changeset.keyId")}: ${signature.keyId}\n${t(
|
||||
let message = `${t("changeset.signedBy")}: ${signature.owner ? signature.owner : t("changeset.noOwner")}\n${t("changeset.keyId")}: ${signature.keyId}\n${t(
|
||||
"changeset.signatureStatus"
|
||||
)}: ${status}`;
|
||||
|
||||
@@ -71,9 +75,6 @@ const SignatureIcon: FC<Props> = ({ signatures, className }) => {
|
||||
return undefined;
|
||||
};
|
||||
|
||||
if (!signature) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Tooltip location="top" message={createTooltipMessage()}>
|
||||
|
||||
Reference in New Issue
Block a user