| 1 | <template> |
| 2 | <n-drawer v-model:show="show" :width="520" placement="right"> |
| 3 | <n-drawer-content v-if="review" closable> |
| 4 | <template #header>Review for report #{{ review.report_id }}</template> |
| 5 | <div class="flex flex-col gap-3"> |
| 6 | <div class="flex flex-wrap items-center gap-2"> |
| 7 | <Badge |
| 8 | v-if="review.overall_verdict" |
| 9 | type="splitted" |
| 10 | bright |
| 11 | :color="review.overall_verdict === 'up' ? 'success' : 'danger'" |
| 12 | > |
| 13 | <template #label>Verdict</template> |
| 14 | <template #value> |
| 15 | {{ review.overall_verdict === "up" ? "Up" : "Down" }} |
| 16 | </template> |
| 17 | </Badge> |
| 18 | <Badge v-if="review.template_used" type="splitted"> |
| 19 | <template #label>Template</template> |
| 20 | <template #value>{{ review.template_used }}</template> |
| 21 | </Badge> |
| 22 | <Badge v-if="review.template_choice" type="splitted" bright> |
| 23 | <template #label>Template choice</template> |
| 24 | <template #value>{{ review.template_choice }}</template> |
| 25 | </Badge> |
| 26 | </div> |
| 27 | |
| 28 | <CardKV v-if="review.missing_steps"> |
| 29 | <template #key>Missing steps</template> |
| 30 | <template #value>{{ review.missing_steps }}</template> |
| 31 | </CardKV> |
| 32 | <CardKV v-if="review.suggested_edits"> |
| 33 | <template #key>Suggested edits</template> |
| 34 | <template #value>{{ review.suggested_edits }}</template> |
| 35 | </CardKV> |
| 36 | |
| 37 | <n-card v-if="review.ioc_reviews.length" size="small" title="IOC corrections" embedded> |
| 38 | <div class="flex flex-col gap-2"> |
| 39 | <CardEntity v-for="ir of review.ioc_reviews" :key="ir.id" embedded size="small"> |
| 40 | <template #default> |
| 41 | <div class="flex items-center gap-2"> |
| 42 | <Badge type="splitted" :color="ir.verdict_correct ? 'success' : 'danger'"> |
| 43 | <template #label>IOC {{ ir.ioc_id }}</template> |
| 44 | <template #value> |
| 45 | {{ ir.verdict_correct ? "Correct" : "Wrong" }} |
| 46 | </template> |
| 47 | </Badge> |
| 48 | </div> |
| 49 | </template> |
| 50 | <template v-if="ir.note" #mainExtra> |
| 51 | {{ ir.note }} |
| 52 | </template> |
| 53 | </CardEntity> |
| 54 | </div> |
| 55 | </n-card> |
| 56 | </div> |
| 57 | </n-drawer-content> |
| 58 | </n-drawer> |
| 59 | </template> |
| 60 | |
| 61 | <script setup lang="ts"> |
| 62 | import type { AiAnalystReview } from "@/types/aiAnalyst.d" |
| 63 | import { NCard, NDrawer, NDrawerContent } from "naive-ui" |
| 64 | import Badge from "@/components/common/Badge.vue" |
| 65 | import CardEntity from "@/components/common/cards/CardEntity.vue" |
| 66 | import CardKV from "@/components/common/cards/CardKV.vue" |
| 67 | |
| 68 | defineProps<{ |
| 69 | review: AiAnalystReview | null |
| 70 | }>() |
| 71 | |
| 72 | const show = defineModel<boolean>("show") |
| 73 | </script> |