From f9c334ba228b3fbb163bc09172c725654fa4bbf8 Mon Sep 17 00:00:00 2001 From: ivannoskov Date: Mon, 2 Feb 2026 11:49:00 +0300 Subject: [PATCH] fix: expand button fix --- .../[workspaceId]/purchase-plans/[projectId]/page.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/dashboard/[workspaceId]/purchase-plans/[projectId]/page.tsx b/app/dashboard/[workspaceId]/purchase-plans/[projectId]/page.tsx index 9e59422..7acfe15 100644 --- a/app/dashboard/[workspaceId]/purchase-plans/[projectId]/page.tsx +++ b/app/dashboard/[workspaceId]/purchase-plans/[projectId]/page.tsx @@ -182,6 +182,7 @@ interface ChannelGroupProps { handleDraftChange: (placementId: string, patch: PlacementInlineDraft) => void; editingCell: EditingCell | null; setEditingCell: (cell: EditingCell | null) => void; + expanded: boolean; } function ChannelGroup({ @@ -193,9 +194,14 @@ function ChannelGroup({ handleDraftChange, editingCell, setEditingCell, + expanded, }: ChannelGroupProps) { const [isOpen, setIsOpen] = useState(true); + useEffect(() => { + setIsOpen(expanded); + }, [expanded]); + const totalCost = placements.reduce((sum, p) => sum + (p.details?.cost?.value || 0), 0); const totalSubscriptions = placements.reduce((sum, p) => sum + (p.placement_post?.subscriptions_count || 0), 0); const totalViews = placements.reduce((sum, p) => sum + (p.placement_post?.views_count || 0), 0); @@ -997,6 +1003,7 @@ export default function PurchasePlanDetailPage() { handleDraftChange={handleDraftChange} editingCell={editingCell} setEditingCell={setEditingCell} + expanded={expandedAll} /> ))}