From e9d60961ef66caa01ed94b2ef112e145197ff083 Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Thu, 20 Jun 2024 09:29:41 +0200 Subject: [PATCH] refactor: use DetailsPage for Recipe details page (#1245) Signed-off-by: Philippe Martin --- packages/frontend/src/pages/Recipe.svelte | 76 +++++++++++-------- .../frontend/src/utils/categoriesUtils.ts | 2 +- 2 files changed, 45 insertions(+), 33 deletions(-) diff --git a/packages/frontend/src/pages/Recipe.svelte b/packages/frontend/src/pages/Recipe.svelte index a9741f622..4cdba8649 100644 --- a/packages/frontend/src/pages/Recipe.svelte +++ b/packages/frontend/src/pages/Recipe.svelte @@ -1,7 +1,6 @@ - + breadcrumbLeftPart="Recipes" + breadcrumbRightPart="{recipe?.name || ''}" + breadcrumbTitle="Go back to Recipes" + on:close="{goToUpPage}" + on:breadcrumbClick="{goToUpPage}"> + +
+ +
+
- - - {#if connectionInfo} -
- -
- {/if} -
- - - - - - - - - - - -
+
+ + + {#if connectionInfo} +
+ +
+ {/if} +
+ + + + + + + + + + + +
+
@@ -98,4 +110,4 @@ function setSelectedModel(modelId: string) { {/each}
-
+ diff --git a/packages/frontend/src/utils/categoriesUtils.ts b/packages/frontend/src/utils/categoriesUtils.ts index 1bbd34309..a2ca81f79 100644 --- a/packages/frontend/src/utils/categoriesUtils.ts +++ b/packages/frontend/src/utils/categoriesUtils.ts @@ -19,7 +19,7 @@ import type { IconDefinition } from '@fortawesome/free-regular-svg-icons'; import { faAlignLeft, faEdit, faImages, faQuestion } from '@fortawesome/free-solid-svg-icons'; -export const getIcon = (scope: string | undefined): IconDefinition | undefined => { +export const getIcon = (scope: string | undefined): IconDefinition => { switch (scope) { case 'natural-language-processing': return faAlignLeft;