From 91ac4137dcf5ea06672ab6e7df63f88dda799635 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 23 Jun 2025 08:15:02 -0600 Subject: [PATCH] Move to separate component --- .../classification/ModelSelectionView.tsx | 50 +++++++++++-------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/web/src/views/classification/ModelSelectionView.tsx b/web/src/views/classification/ModelSelectionView.tsx index 63133842a..ef415efb4 100644 --- a/web/src/views/classification/ModelSelectionView.tsx +++ b/web/src/views/classification/ModelSelectionView.tsx @@ -37,27 +37,37 @@ export default function ModelSelectionView({ return (
{classificationConfigs.map((config) => ( -
onClick(config)} - onContextMenu={() => { - // e.stopPropagation(); - // e.preventDefault(); - // handleClickEvent(true); - }} - > -
-
- {config.name} ({config.state_config != null ? "State" : "Object"}{" "} - Classification) -
-
+ onClick(config)} /> ))}
); } + +type ModelCardProps = { + config: CustomClassificationModelConfig; + onClick: () => void; +}; +function ModelCard({ config, onClick }: ModelCardProps) { + return ( +
onClick()} + onContextMenu={() => { + // e.stopPropagation(); + // e.preventDefault(); + // handleClickEvent(true); + }} + > +
+
+ {config.name} ({config.state_config != null ? "State" : "Object"}{" "} + Classification) +
+
+ ); +}