- calendar-bridge.ts and lists-bridge.ts isolate cross-module deps
- scheduleOnCalendar action: creates event from care schedule with 30-min
slot, title convention (Water/Fertilize/Repot/Prune/custom), reminder opt
- pushOverdueToTaskList action: inserts one task per overdue (plant+schedule)
pair into the default task list, skips duplicate text entries
- CareScheduleEditor: per-row calendar 📅 button opens inline form with
calendar select + optional reminder minutes + success link to /calendar
- Garden page header: PushOverdueButton with auto-dismissing feedback toast
27 lines
806 B
TypeScript
27 lines
806 B
TypeScript
import { notFound } from "next/navigation";
|
|
import { listCalendars } from "@/modules/garden/server/calendar-bridge";
|
|
import { getCareLogs, getCareSchedules, getPlant } from "@/modules/garden/server/queries";
|
|
import { PlantDetail } from "@/modules/garden/components/plant-detail";
|
|
|
|
export default async function PlantPage({ params }: { params: Promise<{ id: string }> }) {
|
|
const { id } = await params;
|
|
const [plant, careLogs, careSchedules, calendars] = await Promise.all([
|
|
getPlant(id),
|
|
getCareLogs(id),
|
|
getCareSchedules(id),
|
|
listCalendars(),
|
|
]);
|
|
if (!plant) notFound();
|
|
|
|
return (
|
|
<div className="page-content">
|
|
<PlantDetail
|
|
plant={plant}
|
|
careLogs={careLogs}
|
|
careSchedules={careSchedules}
|
|
calendars={calendars}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|