feat: add batch-cooking generation entry point to meal planner
Adds a "Batch cooking" button next to "Generate with AI" on the meal plan page, opening the same wizard used on /batch-cooking. Closes the loop on the original ask: batch-cooking sessions can now be started directly from the meal planner, not just from the recipes list. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import { Input } from "@/components/ui/input";
|
|||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
import { BatchCookGenerateDialog } from "@/components/recipe/batch-cook-generate-dialog";
|
||||||
|
|
||||||
type Day = "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun";
|
type Day = "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun";
|
||||||
type MealType = "breakfast" | "lunch" | "dinner" | "snack";
|
type MealType = "breakfast" | "lunch" | "dinner" | "snack";
|
||||||
@@ -180,6 +181,7 @@ export function MealPlanner({
|
|||||||
const [markingCookedIds, setMarkingCookedIds] = useState<Set<string>>(new Set());
|
const [markingCookedIds, setMarkingCookedIds] = useState<Set<string>>(new Set());
|
||||||
const [adding, setAdding] = useState<{ day: Day; mealType: MealType } | null>(null);
|
const [adding, setAdding] = useState<{ day: Day; mealType: MealType } | null>(null);
|
||||||
const [showAiModal, setShowAiModal] = useState(false);
|
const [showAiModal, setShowAiModal] = useState(false);
|
||||||
|
const [showBatchModal, setShowBatchModal] = useState(false);
|
||||||
const [aiGenerating, setAiGenerating] = useState(false);
|
const [aiGenerating, setAiGenerating] = useState(false);
|
||||||
const [aiPhase, setAiPhase] = useState("");
|
const [aiPhase, setAiPhase] = useState("");
|
||||||
const [dietaryPrefs, setDietaryPrefs] = useState("");
|
const [dietaryPrefs, setDietaryPrefs] = useState("");
|
||||||
@@ -321,9 +323,13 @@ export function MealPlanner({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* AI Generate button */}
|
{/* AI Generate buttons */}
|
||||||
<div className="flex justify-end mb-4">
|
<div className="flex justify-end gap-2 mb-4">
|
||||||
<Button variant="ghost" size="sm" onClick={() => setShowAiModal(true)} className="gap-2">
|
<Button variant="outline" size="sm" onClick={() => setShowBatchModal(true)} className="gap-2">
|
||||||
|
<ChefHat className="h-4 w-4" />
|
||||||
|
{t("batchCooking")}
|
||||||
|
</Button>
|
||||||
|
<Button size="sm" onClick={() => setShowAiModal(true)} className="gap-2">
|
||||||
<Sparkles className="h-4 w-4" />
|
<Sparkles className="h-4 w-4" />
|
||||||
{t("generateWithAi")}
|
{t("generateWithAi")}
|
||||||
</Button>
|
</Button>
|
||||||
@@ -533,6 +539,8 @@ export function MealPlanner({
|
|||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
<BatchCookGenerateDialog open={showBatchModal} onOpenChange={setShowBatchModal} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -677,6 +677,7 @@
|
|||||||
"weekOf": "Week of {date}",
|
"weekOf": "Week of {date}",
|
||||||
"sharedMealPlanTitle": "{name}'s Meal Plan",
|
"sharedMealPlanTitle": "{name}'s Meal Plan",
|
||||||
"batchCookBadge": "Batch cooking",
|
"batchCookBadge": "Batch cooking",
|
||||||
|
"batchCooking": "Batch cooking",
|
||||||
"pickDishTitle": "Which dish from \"{recipe}\"?",
|
"pickDishTitle": "Which dish from \"{recipe}\"?",
|
||||||
"pickDishDescription": "This is a batch-cooking session — pick the specific dish for this slot.",
|
"pickDishDescription": "This is a batch-cooking session — pick the specific dish for this slot.",
|
||||||
"back": "Back",
|
"back": "Back",
|
||||||
|
|||||||
@@ -665,6 +665,7 @@
|
|||||||
"weekOf": "Semaine du {date}",
|
"weekOf": "Semaine du {date}",
|
||||||
"sharedMealPlanTitle": "Planning repas de {name}",
|
"sharedMealPlanTitle": "Planning repas de {name}",
|
||||||
"batchCookBadge": "Batch cooking",
|
"batchCookBadge": "Batch cooking",
|
||||||
|
"batchCooking": "Batch cooking",
|
||||||
"pickDishTitle": "Quel plat de \"{recipe}\" ?",
|
"pickDishTitle": "Quel plat de \"{recipe}\" ?",
|
||||||
"pickDishDescription": "C'est une session de batch cooking — choisissez le plat précis pour ce créneau.",
|
"pickDishDescription": "C'est une session de batch cooking — choisissez le plat précis pour ce créneau.",
|
||||||
"back": "Retour",
|
"back": "Retour",
|
||||||
|
|||||||
Reference in New Issue
Block a user