- Fix ShareButton silently swallowing errors from createShareLink; now shows inline error text so failures are visible to the user - Add getShareLinksForEntity server action and EntityShareLink type to _core/share.ts - Add ShareLinkList component — renders active share links per entity with per-row Revoke; renders nothing when empty - Wire ShareLinkList into plant and container detail pages (loaded server-side in parallel with the entity fetch) - Add images jsonb column to garden_containers schema + migration 0018 - Add addContainerImage / removeContainerImage / setContainerPrimaryImage server actions mirroring the plant image pattern (10-image cap, first upload auto-sets cover) - Update ContainerDetailDto, listContainers, getContainer to include images - Rewrite ContainerDetail with Info/Gallery tabs; Gallery tab mirrors plant gallery (3-col grid, star/X overlays, upload button, counter) - Update ContainerShareData and container renderSharedView to show cover image hero and secondary image grid on public share pages
30 lines
962 B
TypeScript
30 lines
962 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";
|
|
import { getShareLinksForEntity } from "@/modules/_core/share";
|
|
|
|
export default async function PlantPage({ params }: { params: Promise<{ id: string }> }) {
|
|
const { id } = await params;
|
|
const [plant, careLogs, careSchedules, calendars, shareLinks] = await Promise.all([
|
|
getPlant(id),
|
|
getCareLogs(id),
|
|
getCareSchedules(id),
|
|
listCalendars(),
|
|
getShareLinksForEntity("garden.plant", id),
|
|
]);
|
|
if (!plant) notFound();
|
|
|
|
return (
|
|
<div className="page-content">
|
|
<PlantDetail
|
|
plant={plant}
|
|
careLogs={careLogs}
|
|
careSchedules={careSchedules}
|
|
calendars={calendars}
|
|
shareLinks={shareLinks}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|