Files
oikos/web/src/lib/components/data-table/renderers/ActivityCancel.svelte
dtoro 50aed11cc4 feat(web): adopt @vincjo/datatables for all tables, standardize shared components
- Add DataTable.svelte: declarative columns, built-in sorting, sticky headers,
  text truncation, column alignment, configurable widths, optional pagination/search
- 12 built-in renderers: BadgeRenderer, StatusBadgeRenderer (unified risk/severity/
  execution/state/type variant mapping), HealthDotRenderer, RelativeTimeRenderer,
  DateRenderer, DurationRenderer, StatusDotRenderer, SignalActions, ApprovalActions,
  ActivityAction, ActivityCancel
- Migrate Overview (task board), Signals, Ops (3 tables) to DataTable
- Refactor EntityTable treegrid to use shared SortHeader, EmptyState, HealthDotRenderer
- Create shared components: EmptyState, StatusBadge, FilterTabs
- Clean up Knowledge.svelte: replace inline relTime() and typeVariant() with shared utils
- Add width, align, truncate column props; table-fixed layout; rounded-xl borders
- Bump version to 0.11.0
2026-07-21 13:19:03 +02:00

23 lines
535 B
Svelte

<script lang="ts">
import { Button } from '$lib/components/ui/button'
import type { ActivityItem } from '$lib/api'
let {
row,
onCancel
}: {
row: ActivityItem
onCancel?: (id: string) => void
} = $props()
function showCancel(status: string): boolean {
return ['pending_approval', 'approved', 'running'].includes(status)
}
</script>
<div class="flex justify-end">
{#if showCancel(row.status)}
<Button size="sm" variant="outline" onclick={() => onCancel?.(row.id)}>Cancel</Button>
{/if}
</div>