Files
archie/ui/src/mappings/MappingRow.vue
T
sam 686da8be4d fix(ui): trim view prose, en dash placeholders, collapse fixed grids on phones
Drop empty-state essays that repeated their titles, the harness native select
becomes the Select component, and the binding and source forms collapse to one
column below sm. Issue-ID and history narration removed from comments.
2026-10-18 15:02:00 +11:00

43 lines
1.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { Button } from "@/components/ui/button";
import { TableCell, TableRow } from "@/components/ui/table";
import { eventTypeLabel } from "@/captures/event-types";
import { ago } from "@/lib/format";
import { matchCountLabel } from "./match-count";
import { eventTypes, type Mapping } from "./state";
/** One saved mapping's summary row. Both of its actions are the page's, not the
* row's: editing opens the editor overlay, deleting opens the confirmation. */
defineProps<{ mapping: Mapping }>();
const emit = defineEmits<{
edit: [mapping: Mapping];
delete: [mapping: Mapping];
}>();
</script>
<template>
<TableRow>
<TableCell class="font-medium">{{ mapping.name }}</TableCell>
<TableCell class="font-mono text-fg-muted">{{
eventTypeLabel(mapping.event_type_id, eventTypes)
}}</TableCell>
<TableCell class="tabular-nums">{{
mapping.fields?.length ?? 0
}}</TableCell>
<TableCell class="tabular-nums">{{ matchCountLabel(mapping) }}</TableCell>
<TableCell class="text-fg-muted">{{
mapping.match_count ? ago(mapping.last_matched_at) : "–"
}}</TableCell>
<TableCell>
<div class="flex justify-end gap-2">
<Button variant="outline" size="xs" @click="emit('edit', mapping)"
>Edit</Button
>
<Button variant="destructive" size="xs" @click="emit('delete', mapping)"
>Delete</Button
>
</div>
</TableCell>
</TableRow>
</template>