fix: expand button fix

This commit is contained in:
ivannoskov
2026-02-02 11:49:00 +03:00
parent 066f6a4f5b
commit f9c334ba22

View File

@@ -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}
/>
))}
</div>