import { useTranslation } from "next-i18next";
import Container from "components/services/widget/container";
import Block from "components/services/widget/block";
import useWidgetAPI from "utils/proxy/use-widget-api";
export default function Component({ service }) {
const { t } = useTranslation();
const { widget } = service;
const { azureType } = widget;
const { userEmail } = widget;
const { data: pipelineData, error: pipelineError } = useWidgetAPI(widget, "pipeline");
const { data: prData, error: prError } = useWidgetAPI(widget, "pr");
if (azureType === "Pipeline") {
if (pipelineError) {
return ;
}
if (!pipelineData || !Array.isArray(pipelineData.value)) {
return (
);
}
return (
{pipelineData.value[0].result ? (
) : (
)}
);
}
if (azureType === "PullRequest") {
if (prError) {
return ;
}
if (!prData) {
return (
);
}
return (
item.createdBy.uniqueName.toLowerCase() === userEmail.toLowerCase())
.length,
})}
/>
item.createdBy.uniqueName.toLowerCase() === userEmail.toLowerCase()).filter((item) => item.reviewers.some((reviewer) => reviewer.vote === 10)).length
})}
/>
);
}
}