33 lines
899 B
Vue
33 lines
899 B
Vue
<script setup lang="ts">
|
|
import { useRouter } from "vue-router";
|
|
|
|
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
|
import NewTaskForm from "./NewTaskForm.vue";
|
|
|
|
const props = defineProps<{ workflow?: string; instructions?: string }>();
|
|
const router = useRouter();
|
|
const open = defineModel<boolean>("open", { default: false });
|
|
|
|
function started(taskId: number) {
|
|
open.value = false;
|
|
void router.push(`/tasks/${taskId}`);
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<Dialog v-model:open="open">
|
|
<DialogContent class="sm:max-w-[640px]">
|
|
<DialogHeader>
|
|
<DialogTitle>New task</DialogTitle>
|
|
</DialogHeader>
|
|
<NewTaskForm
|
|
v-if="open"
|
|
:initial-workflow="props.workflow"
|
|
:initial-instructions="props.instructions"
|
|
@started="started"
|
|
@cancel="open = false"
|
|
/>
|
|
</DialogContent>
|
|
</Dialog>
|
|
</template>
|