More work on CC display

This commit is contained in:
N-Pex 2025-09-09 11:34:48 +02:00
parent 27b27876c0
commit a27864e3d2
7 changed files with 45 additions and 20 deletions

View file

@ -1,5 +1,5 @@
<template>
<div class="cc-summary" v-if="props.flags.length > 0 && infoText.length > 0">
<div class="cc-summary" v-if="flags.length > 0 && infoText.length > 0">
<v-icon class="intervention-icon">{{
showCheck ? "$vuetify.icons.ic_intervention_check" : "$vuetify.icons.ic_intervention"
}}</v-icon
@ -11,18 +11,30 @@
import { computed } from "vue";
import { ProofHintFlags } from "../../models/proof";
const props = defineProps<{
const { multiple, flags } = defineProps<{
multiple: boolean;
flags: ProofHintFlags[];
}>();
const showCheck = computed(() => {
return props.flags.some((f) => f?.valid);
if (!multiple && flags.length == 1) {
return flags[0].generatorSource === "c2pa";
} else if (multiple) {
return flags.some((f) => f.generatorSource === "c2pa")
}
return false;
});
const infoText = computed(() => {
if (props.flags.some((f) => f.generator === "ai")) {
if (!multiple && flags.length == 1) {
if (flags[0].generator === "ai") {
return "<b>This image is generated by AI.</b> Take a closer look at the file details.";
} else if (flags[0].generator === "screenshot") {
return "<b>This is a screenshot.</b> Take a closer look at the file details.";
}
} else if (flags.some((f) => f.generator === "ai")) {
return "<b>Contains AI generated media.</b> Take a closer look at the file details for each.";
} else if (props.flags.some((f) => f.generator === "screenshot")) {
} else if (flags.some((f) => f.generator === "screenshot")) {
return "<b>Contains screenshots.</b> Take a closer look at the file details for each.";
}
return "TODO - Content Credentials Info";