This commit is contained in:
Nicolas Mowen 2025-10-21 17:23:31 -06:00
parent 6c33dda19f
commit f966946713
2 changed files with 38 additions and 33 deletions

View File

@ -12,13 +12,13 @@ export function ImageShadowOverlay({
<> <>
<div <div
className={cn( className={cn(
"pointer-events-none absolute inset-x-0 top-0 z-10 h-[30%] w-full rounded-lg bg-gradient-to-b to-transparent md:rounded-2xl", "pointer-events-none absolute inset-x-0 top-0 z-10 h-[30%] w-full rounded-lg bg-gradient-to-b from-black/20 to-transparent md:rounded-2xl",
upperClassName, upperClassName,
)} )}
/> />
<div <div
className={cn( className={cn(
"pointer-events-none absolute inset-x-0 bottom-0 z-10 h-[10%] w-full rounded-lg bg-gradient-to-t to-transparent md:rounded-2xl", "pointer-events-none absolute inset-x-0 bottom-0 z-10 h-[10%] w-full rounded-lg bg-gradient-to-t from-black/20 to-transparent md:rounded-2xl",
lowerClassName, lowerClassName,
)} )}
/> />

View File

@ -44,7 +44,7 @@ import {
useRef, useRef,
useState, useState,
} from "react"; } from "react";
import { isDesktop, isMobile } from "react-device-detect"; import { isDesktop, isMobile, isMobileOnly } from "react-device-detect";
import { Trans, useTranslation } from "react-i18next"; import { Trans, useTranslation } from "react-i18next";
import { LuPencil, LuTrash2 } from "react-icons/lu"; import { LuPencil, LuTrash2 } from "react-icons/lu";
import { toast } from "sonner"; import { toast } from "sonner";
@ -927,40 +927,45 @@ function ObjectTrainGrid({
<div <div
ref={contentRef} ref={contentRef}
className="scrollbar-container flex flex-wrap gap-3 overflow-y-scroll p-1" className={cn(
"scrollbar-container gap-3 overflow-y-scroll p-1",
isMobileOnly ? "grid grid-cols-2 px-2" : "flex flex-wrap",
)}
> >
{Object.entries(groups).map(([key, group]) => { {Object.entries(groups).map(([key, group]) => {
const event = events?.find((ev) => ev.id == key); const event = events?.find((ev) => ev.id == key);
return ( return (
<GroupedClassificationCard <div>
key={key} <GroupedClassificationCard
group={group} key={key}
event={event} group={group}
threshold={threshold} event={event}
selectedItems={selectedImages} threshold={threshold}
i18nLibrary="views/classificationModel" selectedItems={selectedImages}
objectType={model.object_config?.objects?.at(0) ?? "Object"} i18nLibrary="views/classificationModel"
onClick={(data) => { objectType={model.object_config?.objects?.at(0) ?? "Object"}
if (data) { onClick={(data) => {
onClickImages([data.filename], true); if (data) {
} else { onClickImages([data.filename], true);
handleClickEvent(group, event, true); } else {
} handleClickEvent(group, event, true);
}} }
> }}
{(data) => ( >
<> {(data) => (
<ClassificationSelectionDialog <>
classes={classes} <ClassificationSelectionDialog
modelName={model.name} classes={classes}
image={data.filename} modelName={model.name}
onRefresh={onRefresh} image={data.filename}
> onRefresh={onRefresh}
<TbCategoryPlus className="size-7 cursor-pointer p-1 text-gray-200 hover:rounded-full hover:bg-primary-foreground" /> >
</ClassificationSelectionDialog> <TbCategoryPlus className="size-7 cursor-pointer p-1 text-gray-200 hover:rounded-full hover:bg-primary-foreground" />
</> </ClassificationSelectionDialog>
)} </>
</GroupedClassificationCard> )}
</GroupedClassificationCard>
</div>
); );
})} })}
</div> </div>