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

added model description to model page #1681

Merged
merged 1 commit into from
Dec 11, 2024
Merged
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
1 change: 1 addition & 0 deletions frontend/pages/model/[modelId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export default function Model() {
<PageWithTabs
title={model.name}
subheading={`ID: ${model.id}`}
additionalInfo={model.description}
tabs={tabs}
displayActionButton={model.card !== undefined}
actionButtonTitle='Request access'
Expand Down
29 changes: 17 additions & 12 deletions frontend/src/common/PageWithTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,24 @@ export interface PageTab {
disabledText?: string
}

interface PageWithTabsProps {
title: string
subheading?: string
additionalInfo?: string
tabs: PageTab[]
actionButtonTitle?: string
displayActionButton?: boolean
actionButtonOnClick?: () => void
requiredUrlParams?: ParsedUrlQuery
titleToCopy?: string
subheadingToCopy?: string
sourceModelId?: string
}

export default function PageWithTabs({
title,
subheading,
additionalInfo,
tabs,
actionButtonTitle = '',
displayActionButton = false,
Expand All @@ -28,18 +43,7 @@ export default function PageWithTabs({
titleToCopy = '',
subheadingToCopy = '',
sourceModelId = '',
}: {
title: string
subheading?: string
tabs: PageTab[]
actionButtonTitle?: string
displayActionButton?: boolean
actionButtonOnClick?: () => void
requiredUrlParams?: ParsedUrlQuery
titleToCopy?: string
subheadingToCopy?: string
sourceModelId?: string
}) {
}: PageWithTabsProps) {
const router = useRouter()
const { tab } = router.query

Expand Down Expand Up @@ -157,6 +161,7 @@ export default function PageWithTabs({
)}
{sourceModelId && <Typography fontWeight='bold'>Mirrored from {sourceModelId} (read-only)</Typography>}
</Stack>
<Typography sx={{ pl: 2, pb: 1 }}>{additionalInfo}</Typography>
<Tabs
value={currentTab || false}
onChange={handleChange}
Expand Down
Loading