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`)}