Slash commands (#5718)
Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
@@ -3,11 +3,9 @@ import { useForm } from '@tanstack/react-form';
|
||||
import { Recipe, generateDeepLink, Parameter } from '../../recipe';
|
||||
import { Geese } from '../icons/Geese';
|
||||
import Copy from '../icons/Copy';
|
||||
import { Check, Save, Calendar, X, Play } from 'lucide-react';
|
||||
import { Check, Save, X, Play } from 'lucide-react';
|
||||
import { ExtensionConfig } from '../ConfigContext';
|
||||
import { ScheduleFromRecipeModal } from '../schedule/ScheduleFromRecipeModal';
|
||||
import { Button } from '../ui/button';
|
||||
import { useNavigation } from '../../hooks/useNavigation';
|
||||
|
||||
import { RecipeFormFields } from './shared/RecipeFormFields';
|
||||
import { RecipeFormData } from './shared/recipeFormSchema';
|
||||
@@ -29,7 +27,6 @@ export default function CreateEditRecipeModal({
|
||||
isCreateMode = false,
|
||||
recipeId,
|
||||
}: CreateEditRecipeModalProps) {
|
||||
const setView = useNavigation();
|
||||
const getInitialValues = React.useCallback((): RecipeFormData => {
|
||||
if (recipe) {
|
||||
return {
|
||||
@@ -81,7 +78,6 @@ export default function CreateEditRecipeModal({
|
||||
});
|
||||
}, [form]);
|
||||
const [copied, setCopied] = useState(false);
|
||||
const [isScheduleModalOpen, setIsScheduleModalOpen] = useState(false);
|
||||
const [isSaving, setIsSaving] = useState(false);
|
||||
|
||||
// Initialize selected extensions for the recipe
|
||||
@@ -415,16 +411,6 @@ export default function CreateEditRecipeModal({
|
||||
</Button>
|
||||
|
||||
<div className="flex gap-3">
|
||||
<Button
|
||||
onClick={() => setIsScheduleModalOpen(true)}
|
||||
disabled={!requiredFieldsAreFilled()}
|
||||
variant="outline"
|
||||
size="default"
|
||||
className="inline-flex items-center justify-center gap-2 px-4 py-2"
|
||||
>
|
||||
<Calendar className="w-4 h-4" />
|
||||
Create Schedule
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleSaveRecipeClick}
|
||||
disabled={!requiredFieldsAreFilled() || isSaving}
|
||||
@@ -448,17 +434,6 @@ export default function CreateEditRecipeModal({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ScheduleFromRecipeModal
|
||||
isOpen={isScheduleModalOpen}
|
||||
onClose={() => setIsScheduleModalOpen(false)}
|
||||
recipe={getCurrentRecipe()}
|
||||
onCreateSchedule={(deepLink) => {
|
||||
// Navigate to schedules view with the deep link in state
|
||||
setView('schedules', { pendingScheduleDeepLink: deepLink });
|
||||
setIsScheduleModalOpen(false);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user