From fef34b1df249c84313cea6d634358fea8f801ede Mon Sep 17 00:00:00 2001 From: u8array Date: Tue, 5 May 2026 23:38:31 +0200 Subject: [PATCH] refactor: hoist StatusMessage out of PrintToZebraDialog render --- src/components/Output/PrintToZebraDialog.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/Output/PrintToZebraDialog.tsx b/src/components/Output/PrintToZebraDialog.tsx index f267cb7..8fd50fe 100644 --- a/src/components/Output/PrintToZebraDialog.tsx +++ b/src/components/Output/PrintToZebraDialog.tsx @@ -16,6 +16,15 @@ const LS_PRINTER_UID = "zebra_print_uid"; type Tab = "network" | "browserprint"; interface Status { type: "idle" | "sending" | "success" | "error"; message?: string } +function StatusMessage({ status }: { status: Status }) { + if (status.type === "idle" || status.type === "sending") return null; + return ( +

+ {status.message} +

+ ); +} + interface Props { zpl: string; onClose: () => void; @@ -97,15 +106,6 @@ export function PrintToZebraDialog({ zpl, onClose }: Props) { : "text-muted hover:text-text" }`; - function StatusMessage({ status }: { status: Status }) { - if (status.type === "idle" || status.type === "sending") return null; - return ( -

- {status.message} -

- ); - } - return (