19 lines
1.0 KiB
Vue
19 lines
1.0 KiB
Vue
<script setup lang="ts">
|
|
import { StatusDot } from "@/components/ui/status-dot";
|
|
import { Timestamp } from "@/components/ui/timestamp";
|
|
import { statusKind, statusLabel } from "@/lib/task-meta";
|
|
|
|
/** A workflow's newest run: how it stands, when it started, and a link to it. */
|
|
defineProps<{ runId?: number; status?: string; at?: string; running?: number; known: boolean }>();
|
|
</script>
|
|
|
|
<template>
|
|
<RouterLink v-if="runId" :to="{ name: 'task-detail', params: { id: runId } }" class="inline-flex min-w-0 flex-col gap-0.5 rounded-sm hover:underline focus-visible:outline-2 focus-visible:outline-ring" :aria-label="`Run #${runId}, ${statusLabel(status ?? '')}`" @click.stop>
|
|
<span class="flex items-center gap-1.5 text-label">
|
|
<StatusDot :tone="running ? 'info' : statusKind(status ?? '')" :live="!!running" />{{ running ? `${running} running` : statusLabel(status ?? "") }}
|
|
</span>
|
|
<Timestamp :at="at" class="text-caption text-fg-subtle" />
|
|
</RouterLink>
|
|
<span v-else-if="known" class="text-caption text-fg-subtle">Never run</span>
|
|
</template>
|