2025-09-29 11:24:06 +02:00
|
|
|
import { ProofHintFlags } from "../../models/proof";
|
|
|
|
|
import dayjs from "dayjs";
|
|
|
|
|
|
2025-09-29 16:45:38 +02:00
|
|
|
export const interventionText = (t: any, f: ProofHintFlags): string | undefined => {
|
2025-09-29 11:24:06 +02:00
|
|
|
let res = "";
|
2025-09-29 16:45:38 +02:00
|
|
|
if (f.generator === "camera") {
|
|
|
|
|
res += "<b>" + t("cc.captured_with_camera") + "</b> ";
|
|
|
|
|
} else if (f.generator === "screenshot") {
|
|
|
|
|
res += "<b>" + (f.generatorSource === "c2pa" ? t("cc.screenshot") : t("cc.screenshot_probably")) + "</b> ";
|
|
|
|
|
} else if (f.generator === "ai") {
|
|
|
|
|
res += "<b>" + t("cc.generated_with_ai") + "</b> ";
|
|
|
|
|
}
|
|
|
|
|
if ((f.edits?.length ?? 0) > 0) {
|
|
|
|
|
res += "<b>" + t("cc.modified") + "</b> ";
|
|
|
|
|
}
|
|
|
|
|
if (f.creationDate && dayjs().diff(f.creationDate, "month") >= 3) {
|
|
|
|
|
res += "<b>" + t("cc.older_than_n_months", { n: 3 }) + "</b> ";
|
2025-09-29 11:24:06 +02:00
|
|
|
}
|
2025-09-29 16:45:38 +02:00
|
|
|
if (res === "") return undefined;
|
|
|
|
|
return res;
|
2025-09-29 11:24:06 +02:00
|
|
|
};
|