Skip to content

Commit

Permalink
both
Browse files Browse the repository at this point in the history
  • Loading branch information
bchu1 committed Sep 26, 2024
1 parent 9ed0fcc commit dcad39b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { TomogramTypeBadge } from 'app/components/TomogramTypeBadge'
import { IdPrefix } from 'app/constants/idPrefixes'
import { useI18n } from 'app/hooks/useI18n'
import { TomogramV2 } from 'app/types/gqlResponseTypes'
import { getTomogramName } from 'app/utils/tomograms'
Expand All @@ -15,7 +17,10 @@ export function TomogramSelectorOption({
<div>
<div className="font-semibold">{getTomogramName(tomogram)}</div>
<div className="text-sds-body-xxs text-sds-color-primitive-gray-500">
{t('tomogramId')}: {tomogram.id}
{t('tomogramId')}: {IdPrefix.Tomogram}-{tomogram.id}{' '}
{tomogram.isStandardized && (
<TomogramTypeBadge type="standard" size="small" />
)}
</div>
<div className="text-sds-body-xxs text-sds-color-primitive-gray-500">
{t('tomogramSampling')}:{' '}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@ import { Tooltip } from './Tooltip'

export interface TomogramTypeBadgeProps {
type: 'standard' | 'author'
size?: 'default' | 'small'
showTooltip?: boolean
}

export function TomogramTypeBadge({
type,
size = 'default',
showTooltip,
}: TomogramTypeBadgeProps) {
const { t } = useI18n()

const badge = (
<div
className={cns(
'h-[20px] px-sds-xs py-sds-xxxs !text-sds-body-xxxs text-[#002660] leading-sds-body-xxxs rounded inline-flex bg-[#e9f1ff]',
'inline-flex items-center px-sds-xs py-sds-xxxs !text-sds-body-xxxs text-[#002660] leading-sds-body-xxxs rounded bg-[#e9f1ff]',
size === 'small' ? 'h-[16px]' : 'h-[20px]',
showTooltip && 'cursor-pointer',
)}
>
Expand Down
1 change: 1 addition & 0 deletions frontend/packages/data-portal/app/constants/idPrefixes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export enum IdPrefix {
Deposition = 'CZCDP',
Run = 'RN',
TiltSeries = 'TS',
Tomogram = 'TM',
}

0 comments on commit dcad39b

Please sign in to comment.