From 7885884e45214b3b346710c300ebd4b21b52a107 Mon Sep 17 00:00:00 2001 From: Yves Gugger Date: Wed, 17 Dec 2025 10:00:27 +0100 Subject: [PATCH] Fix TypeScript type casting for details object --- .../src/components/analyze/AnalyzePanel.tsx | 64 ++++++++++--------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/frontend/src/components/analyze/AnalyzePanel.tsx b/frontend/src/components/analyze/AnalyzePanel.tsx index 39890f0..9a2afb1 100644 --- a/frontend/src/components/analyze/AnalyzePanel.tsx +++ b/frontend/src/components/analyze/AnalyzePanel.tsx @@ -489,37 +489,43 @@ export function AnalyzePanel() { {/* Radio Test Details */} - {item.key === 'radio_test' && item.details && ( -
- {item.details.syllables !== undefined && ( - - {item.details.syllables} syllables - - )} - {item.details.length !== undefined && ( - - {item.details.length} chars - - )} - {item.details.has_hyphen && ( - - has hyphen - - )} - {item.details.has_digits && ( - - has digits - - )} -
- )} + {item.key === 'radio_test' && item.details && (() => { + const d = item.details as Record + return ( +
+ {d.syllables !== undefined && ( + + {d.syllables} syllables + + )} + {d.length !== undefined && ( + + {d.length} chars + + )} + {d.has_hyphen && ( + + has hyphen + + )} + {d.has_digits && ( + + has digits + + )} +
+ ) + })()} {/* Registrar Details */} - {(item.key === 'tld_cheapest_register_usd' || item.key === 'tld_cheapest_renew_usd') && item.details?.registrar && ( -
- via {item.details.registrar} -
- )} + {(item.key === 'tld_cheapest_register_usd' || item.key === 'tld_cheapest_renew_usd') && item.details && (() => { + const d = item.details as Record + return d.registrar ? ( +
+ via {d.registrar} +
+ ) : null + })()}