"use client"; import { useState, useTransition } from "react"; import Link from "next/link"; import { useRouter } from "next/navigation"; import { deletePlant, addPlantImage, removePlantImage, setPrimaryImage } from "../server/actions"; import type { CalendarDto } from "../server/calendar-bridge"; import type { CareLogDto, CareScheduleDto, PlantDetailDto } from "../server/queries"; import { ShareButton } from "@/components/share-button"; import { ShareLinkList } from "@/components/share-link-list"; import type { EntityShareLink } from "@/modules/_core/share"; import { CareHistoryList } from "./care-history-list"; import { CareLogForm } from "./care-log-form"; import { CareScheduleEditor } from "./care-schedule-editor"; type Tab = "info" | "gallery" | "care"; type Props = { plant: PlantDetailDto; careLogs: CareLogDto[]; careSchedules: CareScheduleDto[]; calendars: CalendarDto[]; shareLinks: EntityShareLink[]; }; function InfoRow({ label, value, children, }: { label: string; value?: string | null; children?: React.ReactNode; }) { if (!value && !children) return null; return (
{plant.scientificName}
)}Recent care
No photos yet.
) : ({galleryError}
}Log care
History