@@ -15,10 +15,38 @@ import { Button, ButtonSize, ButtonTheme } from '@/shared/ui/Button';
1515import chevronleft from '@/shared/assets/icons/ChevronLeftBlack.svg' ;
1616import chevronright from '@/shared/assets/icons/ChevronRightBlack.svg' ;
1717import { useRouter , useParams } from 'next/navigation' ;
18+ import { linkify } from '@/shared/ui/v2/Chatbot/utils/linkify' ;
1819import { useClientTranslation } from '@/shared/i18n' ;
1920import { NewsCard } from '@/widgets/NewsCard' ;
2021import { ShareButton } from '@/shared/ui/v2/ShareButton' ;
2122
23+ type HeroImageProps = {
24+ picture ?: string ;
25+ } ;
26+
27+ const HeroImage = ( { picture } : HeroImageProps ) => {
28+ if ( ! picture ) return < div className = { cls . noImageContainer } /> ;
29+
30+ return (
31+ < div className = { cls . imageContainer } >
32+ < Image
33+ src = { picture }
34+ alt = ""
35+ className = { cls . imageBlur }
36+ width = { 100 }
37+ height = { 600 }
38+ />
39+ < Image
40+ src = { picture }
41+ alt = ""
42+ className = { cls . image }
43+ width = { 100 }
44+ height = { 600 }
45+ />
46+ </ div >
47+ ) ;
48+ } ;
49+
2250const NewsElementPage = ( ) => {
2351 useScrollToTop ( ) ;
2452 const params = useParams ( ) ;
@@ -45,6 +73,9 @@ const NewsElementPage = () => {
4573 const picture = post . titlePicture ?. id
4674 ? `${ directusBaseUrl } /assets/${ post . titlePicture . id } `
4775 : undefined ;
76+
77+ const bodyHtml = linkify ( post ?. bodyText ?? '' ) ;
78+
4879 return (
4980 < Container >
5081 < div className = { cls . navButtons } >
@@ -84,26 +115,7 @@ const NewsElementPage = () => {
84115 </ Button >
85116 </ div >
86117 < div className = { classNames ( cls . NewsElementPage ) } >
87- { picture ? (
88- < div className = { cls . imageContainer } >
89- < Image
90- src = { picture }
91- alt = { '' }
92- className = { cls . imageBlur }
93- width = { 100 }
94- height = { 600 }
95- />
96- < Image
97- src = { picture }
98- alt = { '' }
99- className = { cls . image }
100- width = { 100 }
101- height = { 600 }
102- />
103- </ div >
104- ) : (
105- < div className = { cls . noImageContainer } />
106- ) }
118+ < HeroImage picture = { picture } />
107119
108120 < h1 className = { cls . title } > { post ?. title } </ h1 >
109121
@@ -114,7 +126,10 @@ const NewsElementPage = () => {
114126 < span className = { cls . date } > { post ?. date || 'Date/Time' } </ span >
115127 </ div >
116128
117- < p className = { cls . text } > { post ?. bodyText } </ p >
129+ < div
130+ className = { cls . text }
131+ dangerouslySetInnerHTML = { { __html : bodyHtml } }
132+ />
118133
119134 < div className = { cls . shareButton } >
120135 < ShareButton >
0 commit comments