From 7f6dc09b7e1384285061ab061b63d5758f45897c Mon Sep 17 00:00:00 2001 From: david Date: Tue, 31 Mar 2026 20:48:29 +0200 Subject: [PATCH] . --- .../use-customer-summary-panel.controller.ts | 15 ++---- .../customer-summary-panel.tsx | 16 +------ .../web/list/ui/pages/list-customers-page.tsx | 1 - .../hooks/side-panel/use-side-panel-state.ts | 48 +++++-------------- 4 files changed, 19 insertions(+), 61 deletions(-) diff --git a/modules/customers/src/web/list/controllers/use-customer-summary-panel.controller.ts b/modules/customers/src/web/list/controllers/use-customer-summary-panel.controller.ts index 399edc2f..13af5b79 100644 --- a/modules/customers/src/web/list/controllers/use-customer-summary-panel.controller.ts +++ b/modules/customers/src/web/list/controllers/use-customer-summary-panel.controller.ts @@ -18,7 +18,7 @@ export const useCustomerSummaryPanelController = ({ const panelState = useRightPanelState({ defaultMode: initialMode, - defaultVisibility: initialOpen ? "temporary" : "hidden", + defaultVisibility: initialOpen ? "visible" : "hidden", }); const query = useCustomerGetQuery(customerId, { @@ -26,16 +26,11 @@ export const useCustomerSummaryPanelController = ({ }); const openCustomerPanel = useCallback( - (nextCustomerId: string, mode: RightPanelMode = "view") => { - setCustomerId(nextCustomerId); - - if (panelState.isPinned) { - panelState.openPersistent(mode); - } else { - panelState.openTemporary(mode); - } + (id: string, mode: RightPanelMode = "view") => { + setCustomerId(id); + panelState.open(mode); }, - [panelState.isPinned, panelState.openTemporary, panelState.openPersistent] + [panelState.open] ); const closePanel = useCallback(() => { diff --git a/modules/customers/src/web/list/ui/blocks/customer-summary-panel/customer-summary-panel.tsx b/modules/customers/src/web/list/ui/blocks/customer-summary-panel/customer-summary-panel.tsx index f78067ff..2ac97264 100644 --- a/modules/customers/src/web/list/ui/blocks/customer-summary-panel/customer-summary-panel.tsx +++ b/modules/customers/src/web/list/ui/blocks/customer-summary-panel/customer-summary-panel.tsx @@ -2,7 +2,7 @@ import { RightPanel } from "@repo/rdx-ui/components"; import type { RightPanelMode, RightPanelVisibility } from "@repo/rdx-ui/hooks"; import { Button } from "@repo/shadcn-ui/components"; import { cn } from "@repo/shadcn-ui/lib/utils"; -import { PencilIcon, PinIcon, PinOffIcon } from "lucide-react"; +import { PencilIcon } from "lucide-react"; import type { Customer } from "../../../../shared"; @@ -51,7 +51,6 @@ interface CustomerSummaryPanelProps { mode: RightPanelMode; onOpenChange: (open: boolean) => void; - onTogglePinned: () => void; onEdit?: (customer: Customer) => void; className?: string; @@ -63,12 +62,9 @@ export const CustomerSummaryPanel = ({ visibility, mode, onOpenChange, - onTogglePinned, onEdit, className, }: CustomerSummaryPanelProps) => { - const isPinned = visibility === "persistent"; - const titleMap: Record = { view: "Ficha de cliente", edit: "Editar cliente", @@ -80,16 +76,6 @@ export const CustomerSummaryPanel = ({ className={cn("bg-transparent", className)} headerActions={ <> - - {customer ? (