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 { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { BatchCookGenerateDialog } from "@/components/recipe/batch-cook-generate-dialog";
|
||||
|
||||
type Day = "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun";
|
||||
type MealType = "breakfast" | "lunch" | "dinner" | "snack";
|
||||
@@ -180,6 +181,7 @@ export function MealPlanner({
|
||||
const [markingCookedIds, setMarkingCookedIds] = useState<Set<string>>(new Set());
|
||||
const [adding, setAdding] = useState<{ day: Day; mealType: MealType } | null>(null);
|
||||
const [showAiModal, setShowAiModal] = useState(false);
|
||||
const [showBatchModal, setShowBatchModal] = useState(false);
|
||||
const [aiGenerating, setAiGenerating] = useState(false);
|
||||
const [aiPhase, setAiPhase] = useState("");
|
||||
const [dietaryPrefs, setDietaryPrefs] = useState("");
|
||||
@@ -321,9 +323,13 @@ export function MealPlanner({
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* AI Generate button */}
|
||||
<div className="flex justify-end mb-4">
|
||||
<Button variant="ghost" size="sm" onClick={() => setShowAiModal(true)} className="gap-2">
|
||||
{/* AI Generate buttons */}
|
||||
<div className="flex justify-end gap-2 mb-4">
|
||||
<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" />
|
||||
{t("generateWithAi")}
|
||||
</Button>
|
||||
@@ -533,6 +539,8 @@ export function MealPlanner({
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
)}
|
||||
|
||||
<BatchCookGenerateDialog open={showBatchModal} onOpenChange={setShowBatchModal} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -677,6 +677,7 @@
|
||||
"weekOf": "Week of {date}",
|
||||
"sharedMealPlanTitle": "{name}'s Meal Plan",
|
||||
"batchCookBadge": "Batch cooking",
|
||||
"batchCooking": "Batch cooking",
|
||||
"pickDishTitle": "Which dish from \"{recipe}\"?",
|
||||
"pickDishDescription": "This is a batch-cooking session — pick the specific dish for this slot.",
|
||||
"back": "Back",
|
||||
|
||||
@@ -665,6 +665,7 @@
|
||||
"weekOf": "Semaine du {date}",
|
||||
"sharedMealPlanTitle": "Planning repas de {name}",
|
||||
"batchCookBadge": "Batch cooking",
|
||||
"batchCooking": "Batch cooking",
|
||||
"pickDishTitle": "Quel plat de \"{recipe}\" ?",
|
||||
"pickDishDescription": "C'est une session de batch cooking — choisissez le plat précis pour ce créneau.",
|
||||
"back": "Retour",
|
||||
|
||||
Reference in New Issue
Block a user