Skip to content
Draft
Show file tree
Hide file tree
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
7 changes: 3 additions & 4 deletions apps/webapp/app/[modelId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import BreadcrumbsComponent from '@/components/breadcrumbs-component';
import ModelsDropdown from '@/components/nav/models-dropdown';
import SearchInferenceModelPane from '@/components/panes/search-inference-model-pane';
import { BreadcrumbItem, BreadcrumbLink, BreadcrumbPage } from '@/components/shadcn/breadcrumbs';
import { getModelById, getModelByIdWithSourceSets } from '@/lib/db/model';
import { getModelByIdWithSourceSets } from '@/lib/db/model';
import { getSourceRelease } from '@/lib/db/source';
import { makeAuthedUserFromSessionOrReturnNull } from '@/lib/db/user';
import { getLayerNumAsStringFromSource } from '@/lib/utils/source';
import { SourceReleaseWithRelations } from '@/prisma/generated/zod';
import { Metadata } from 'next';
import { notFound } from 'next/navigation';
Expand Down Expand Up @@ -45,15 +44,15 @@ export async function generateMetadata({
};
}

let title = `${params.modelId.toUpperCase()}`;
let title = `${params.modelId}`;
let description = '';

const model = await getModelById(params.modelId);
if (model) {
if (searchParams?.q) {
title = `🔍 ${searchParams.q}`;
description =
params.modelId.toUpperCase() +
params.modelId +
(searchParams?.sourceSet ? ` · ${searchParams.sourceSet.toUpperCase()}` : '') +
(searchParams?.selectedLayers && JSON.parse(searchParams?.selectedLayers).length > 0
? ` · Layer${JSON.parse(searchParams?.selectedLayers).length !== 1 ? 's' : ''}${JSON.parse(
Expand Down
Loading