| 1 | <template> |
| 2 | <div> |
| 3 | <CardEntity :embedded :clickable hoverable> |
| 4 | <template #headerMain> |
| 5 | <div class="text-default text-base"> |
| 6 | {{ activeResponse.name }} |
| 7 | </div> |
| 8 | </template> |
| 9 | |
| 10 | <template #headerExtra> |
| 11 | <n-button size="small" @click.stop="showDetails = true"> |
| 12 | <template #icon> |
| 13 | <Icon :name="InfoIcon" /> |
| 14 | </template> |
| 15 | </n-button> |
| 16 | </template> |
| 17 | |
| 18 | <template #default> |
| 19 | <p class="text-sm"> |
| 20 | {{ activeResponse.description }} |
| 21 | </p> |
| 22 | </template> |
| 23 | |
| 24 | <template v-if="!hideActions" #footerExtra> |
| 25 | <ActiveResponseActions :agent-id :active-response size="small" /> |
| 26 | </template> |
| 27 | </CardEntity> |
| 28 | |
| 29 | <n-modal |
| 30 | v-model:show="showDetails" |
| 31 | preset="card" |
| 32 | :style="{ maxWidth: 'min(800px, 90vw)', minHeight: 'min(400px, 90vh)', overflow: 'hidden' }" |
| 33 | :title="activeResponse.name" |
| 34 | :bordered="false" |
| 35 | segmented |
| 36 | > |
| 37 | <ActiveResponseDetails :active-response /> |
| 38 | </n-modal> |
| 39 | </div> |
| 40 | </template> |
| 41 | |
| 42 | <script setup lang="ts"> |
| 43 | import type { SupportedActiveResponse } from "@/types/activeResponse.d" |
| 44 | import { NButton, NModal } from "naive-ui" |
| 45 | import { ref, toRefs } from "vue" |
| 46 | import CardEntity from "@/components/common/cards/CardEntity.vue" |
| 47 | import Icon from "@/components/common/Icon.vue" |
| 48 | import ActiveResponseActions from "./ActiveResponseActions.vue" |
| 49 | import ActiveResponseDetails from "./ActiveResponseDetails.vue" |
| 50 | |
| 51 | const props = defineProps<{ |
| 52 | activeResponse: SupportedActiveResponse |
| 53 | embedded?: boolean |
| 54 | clickable?: boolean |
| 55 | hideActions?: boolean |
| 56 | agentId?: string | number |
| 57 | }>() |
| 58 | const { activeResponse, embedded, agentId, hideActions, clickable } = toRefs(props) |
| 59 | |
| 60 | const InfoIcon = "carbon:information" |
| 61 | const showDetails = ref(false) |
| 62 | </script> |