import { MediaInterventionFlags } from "../../models/proof"; import dayjs from "dayjs"; export const interventionText = (t: any, f: MediaInterventionFlags): string | undefined => { let res = ""; if (f.generator === "camera") { res += "" + t("cc.captured_with_camera") + " "; } else if (f.generator === "screenshot") { res += "" + t("cc.screenshot_probably") + " "; } else if (f.generator === "ai") { res += "" + t("cc.generated_with_ai") + " "; } if (f.modified) { res += "" + t("cc.modified") + " "; } if (f.creationDate && dayjs().diff(f.creationDate, "month") >= 3) { res += "" + t("cc.older_than_n_months", { n: 3 }) + " "; } if (res === "") return undefined; return res; };