- logCare/deleteCareLog actions with schedule update and reminder wiring - upsertCareSchedule/deleteCareSchedule/toggleCareSchedule actions - updateScheduleAfterCare helper cancels old reminder, schedules new one - getCareLogs/getCareSchedules/getOverduePlants/getCareDueSoon queries - CareLogForm, CareScheduleEditor, CareHistoryList components - Plant detail Care tab wired up with schedule editor + log form + history - Log plant care quick-add added to garden manifest
20 lines
641 B
TypeScript
20 lines
641 B
TypeScript
import { notFound } from "next/navigation";
|
|
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] = await Promise.all([
|
|
getPlant(id),
|
|
getCareLogs(id),
|
|
getCareSchedules(id),
|
|
]);
|
|
if (!plant) notFound();
|
|
|
|
return (
|
|
<div className="page-content">
|
|
<PlantDetail plant={plant} careLogs={careLogs} careSchedules={careSchedules} />
|
|
</div>
|
|
);
|
|
}
|