Skip to content

Commit

Permalink
feat: Added created by and timestamp to model view (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaslf97 authored Oct 15, 2024
1 parent a494e7f commit 36e1357
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ export const ModelMetadataView = ({
<Typography variant="h3" as="h2">
Model metadata
</Typography>

<div>
<OutcropAnalogueGroup
modelIdParent={modelIdParent}
Expand Down
7 changes: 7 additions & 0 deletions src/features/ModelView/ModelNameFrame/ModelNameFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ import { AnalogueModelDetail } from '../../../api/generated';
import * as Styled from './ModelNameFrame.styled';

export const ModelNameFrame = ({ model }: { model?: AnalogueModelDetail }) => {
const date = model?.createdDate
? new Date(model.createdDate).toDateString().slice(4)
: '';

return (
<Styled.NameFrame className="metadata-name-frame">
{model ? (
<Typography variant="h2" as="h1">
{model.name}
<Typography>
Added by {model.createdBy} on {date}
</Typography>
</Typography>
) : (
<Typography variant="h2" as="h1">
Expand Down

0 comments on commit 36e1357

Please sign in to comment.