diff --git a/web/public/locales/en/views/classificationModel.json b/web/public/locales/en/views/classificationModel.json index 67c6660df..2f14df78d 100644 --- a/web/public/locales/en/views/classificationModel.json +++ b/web/public/locales/en/views/classificationModel.json @@ -52,9 +52,16 @@ "categorizeImageAs": "Classify Image As:", "categorizeImage": "Classify Image", "noModels": { - "title": "No Classification Models", - "description": "Create a custom model to classify objects or monitor state changes in your cameras.", - "buttonText": "Create Classification Model" + "object": { + "title": "No Object Classification Models", + "description": "Create a custom model to classify detected objects.", + "buttonText": "Create Object Model" + }, + "state": { + "title": "No State Classification Models", + "description": "Create a custom model to monitor and classify state changes in specific camera areas.", + "buttonText": "Create State Model" + } }, "wizard": { "title": "Create New Classification", diff --git a/web/src/views/classification/ModelSelectionView.tsx b/web/src/views/classification/ModelSelectionView.tsx index fc350c51c..26c75a7d9 100644 --- a/web/src/views/classification/ModelSelectionView.tsx +++ b/web/src/views/classification/ModelSelectionView.tsx @@ -75,21 +75,6 @@ export default function ModelSelectionView({ return ; } - if (classificationConfigs.length == 0) { - return ( - <> - { - setNewModel(false); - refreshConfig(); - }} - /> - setNewModel(true)} />; - - ); - } - return (
{ if (value) { - // Restrict viewer navigation setPageToggle(value); } }} @@ -142,31 +126,45 @@ export default function ModelSelectionView({
- {selectedClassificationConfigs.map((config) => ( - onClick(config)} + {selectedClassificationConfigs.length === 0 ? ( + setNewModel(true)} + modelType={pageToggle} /> - ))} + ) : ( + selectedClassificationConfigs.map((config) => ( + onClick(config)} + /> + )) + )}
); } -function NoModelsView({ onCreateModel }: { onCreateModel: () => void }) { +function NoModelsView({ + onCreateModel, + modelType, +}: { + onCreateModel: () => void; + modelType: ModelType; +}) { const { t } = useTranslation(["views/classificationModel"]); + const typeKey = modelType === "objects" ? "object" : "state"; return (
- {t("noModels.title")} + {t(`noModels.${typeKey}.title`)}
- {t("noModels.description")} + {t(`noModels.${typeKey}.description`)}