Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use DetailsPage for Model details page #1241

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions packages/frontend/src/pages/Model.svelte
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
<script lang="ts">
import NavPage from '/@/lib/NavPage.svelte';
import MarkdownRenderer from '/@/lib/markdown/MarkdownRenderer.svelte';
import { catalog } from '/@/stores/catalog';
import { DetailsPage } from '@podman-desktop/ui-svelte';
import { router } from 'tinro';

export let modelId: string;

$: model = $catalog.models.find(m => m.id === modelId);

export function goToUpPage(): void {
router.goto('/models');
}
</script>

<NavPage
lastPage="{{ name: 'Models', path: '/models' }}"
<DetailsPage
title="{model?.name || ''}"
searchEnabled="{false}"
loading="{model === undefined}">
breadcrumbLeftPart="Models"
breadcrumbRightPart="{model?.name || ''}"
breadcrumbTitle="Go back to Models"
on:close="{goToUpPage}"
on:breadcrumbClick="{goToUpPage}">
<svelte:fragment slot="content">
<div class="flex flex-row w-full">
<div class="flex flex-row w-full h-full bg-[var(--pd-content-bg)] overflow-y-auto">
<div class="flex-grow p-5">
<MarkdownRenderer source="{model?.description}" />
</div>
</div>
</svelte:fragment>
</NavPage>
</DetailsPage>