@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
import { Table , BodyLong } from '@navikt/ds-react' ;
3
3
import { PublishingCalendarEntryProps } from 'types/content-props/publishing-calendar-props' ;
4
4
import { ContentProps , ContentType } from 'types/content-props/_content-common' ;
5
+ import { LenkeInline } from 'components/_common/lenke/LenkeInline' ;
5
6
6
7
// eslint-disable-next-line css-modules/no-unused-class
7
8
import style from './PublishingCalendar.module.scss' ;
@@ -12,6 +13,7 @@ interface PublishingCalendarEntryData {
12
13
publDate : Date ;
13
14
day : string ;
14
15
month : string ;
16
+ link ?: string ;
15
17
}
16
18
17
19
const monthShortName = [
@@ -47,6 +49,7 @@ const processEntry = (item: PublishingCalendarEntryProps): PublishingCalendarEnt
47
49
publDate,
48
50
day : publDate . getDate ( ) . toString ( ) + '.' ,
49
51
month : monthShortName [ publDate . getMonth ( ) ] ,
52
+ link : item . data . link ?. _path ,
50
53
} ;
51
54
} ;
52
55
@@ -56,6 +59,7 @@ export const PublishingCalendarEntryLegacyPart = (props: ContentProps) => {
56
59
}
57
60
58
61
const entry = processEntry ( props ) ;
62
+
59
63
return (
60
64
< Table . Row >
61
65
< Table . DataCell >
@@ -66,7 +70,11 @@ export const PublishingCalendarEntryLegacyPart = (props: ContentProps) => {
66
70
</ Table . DataCell >
67
71
< Table . DataCell >
68
72
< BodyLong className = { style . dateInfo } > { entry . period } </ BodyLong >
69
- < BodyLong > { entry . displayName } </ BodyLong >
73
+ { entry . link ? (
74
+ < LenkeInline href = { entry . link } > { entry . displayName } </ LenkeInline >
75
+ ) : (
76
+ < BodyLong > { entry . displayName } </ BodyLong >
77
+ ) }
70
78
</ Table . DataCell >
71
79
</ Table . Row >
72
80
) ;
0 commit comments