<script lang="ts">
	import { post } from 'src/lib/requests.svelte';
	import type { Model } from 'src/routes/models/edit/+page.svelte';
	import RunModel from './RunModel.svelte';
	import TasksTable from './tasks/TasksTable.svelte';
	import Stats from './tasks/Stats.svelte';

	const { active, model }: { active?: boolean; model: Model } = $props();

	let table: TasksTable;
</script>

{#if active}
	<div class="content selected">
		<RunModel {model} on:upload={() => table.getList()} on:taskReload={() => table.getList()} />
		<TasksTable {model} bind:this={table} />
		<Stats {model} />
	</div>
{/if}
