Cleanup cursor pointer for classification cards

This commit is contained in:
Nicolas Mowen 2025-12-18 07:27:24 -07:00
parent 86f3244b6a
commit eefa0977e3
2 changed files with 8 additions and 1 deletions

View File

@ -40,6 +40,7 @@ type ClassificationCardProps = {
data: ClassificationItemData;
threshold?: ClassificationThreshold;
selected: boolean;
clickable: boolean;
i18nLibrary: string;
showArea?: boolean;
count?: number;
@ -56,6 +57,7 @@ export const ClassificationCard = forwardRef<
data,
threshold,
selected,
clickable,
i18nLibrary,
showArea = true,
count,
@ -101,11 +103,12 @@ export const ClassificationCard = forwardRef<
<div
ref={ref}
className={cn(
"relative flex size-full cursor-pointer flex-col overflow-hidden rounded-lg outline outline-[3px]",
"relative flex size-full flex-col overflow-hidden rounded-lg outline outline-[3px]",
className,
selected
? "shadow-selected outline-selected"
: "outline-transparent duration-500",
clickable && "cursor-pointer",
)}
onClick={(e) => {
const isMeta = e.metaKey || e.ctrlKey;
@ -289,6 +292,7 @@ export function GroupedClassificationCard({
data={bestItem}
threshold={threshold}
selected={selectedItems.includes(bestItem.filename)}
clickable={true}
i18nLibrary={i18nLibrary}
count={group.length}
onClick={(_, meta) => {
@ -413,6 +417,7 @@ export function GroupedClassificationCard({
data={data}
threshold={threshold}
selected={false}
clickable={false}
i18nLibrary={i18nLibrary}
onClick={() => {}}
>

View File

@ -804,6 +804,7 @@ function DatasetGrid({
name: "",
}}
showArea={false}
clickable={selectedImages.length > 0}
selected={selectedImages.includes(image)}
i18nLibrary="views/classificationModel"
onClick={(data, _) => onClickImages([data.filename], true)}
@ -962,6 +963,7 @@ function StateTrainGrid({
data={data}
threshold={threshold}
selected={selectedImages.includes(data.filename)}
clickable={selectedImages.length > 0}
i18nLibrary="views/classificationModel"
showArea={false}
onClick={(data, meta) => onClickImages([data.filename], meta)}