"use client"; import { Modal } from "../ui/Modal"; import { Button } from "../ui/Button"; import { Input } from "../ui/Input"; import { CronExpressionHelper } from "../CronExpressionHelper"; import { BashSnippetHelper } from "../BashSnippetHelper"; import { Edit, Terminal } from "lucide-react"; interface EditTaskModalProps { isOpen: boolean; onClose: () => void; onSubmit: (e: React.FormEvent) => void; form: { schedule: string; command: string; comment: string; }; onFormChange: (updates: Partial) => void; } export function EditTaskModal({ isOpen, onClose, onSubmit, form, onFormChange, }: EditTaskModalProps) { const handleInsertSnippet = (snippet: string) => { const currentContent = form.command; const newContent = currentContent ? `${currentContent}\n\n${snippet}` : snippet; onFormChange({ command: newContent }); }; return (
{/* Schedule */}
onFormChange({ schedule: value })} placeholder="* * * * *" showPatterns={true} />
{/* Command */}
onFormChange({ command: e.target.value })} placeholder="/usr/bin/command" className="font-mono bg-muted/30 border-border/50 focus:border-primary/50" required />
{/* Bash Snippets Helper */}

💡 Useful Bash Snippets

{/* Description */}
onFormChange({ comment: e.target.value })} placeholder="What does this task do?" className="bg-muted/30 border-border/50 focus:border-primary/50" />
{/* Actions */}
); }