11'use client'
22
3- import { Article , SharedRichTextComponent } from '../services/cms'
4- import { stripHtmlTags } from '@/util/stripHTMLTags'
5- import useWebShare from '../hooks/useWebShare'
3+ import { useMemo } from 'react'
4+
5+ import { useCowAnalytics } from '@cowprotocol/analytics'
6+ import { CmsImage , Color , Media } from '@cowprotocol/ui'
7+
8+ import ReactMarkdown from 'react-markdown'
9+ import rehypeRaw from 'rehype-raw'
10+ import styled from 'styled-components/macro'
11+
612import { CategoryLinks } from '@/components/CategoryLinks'
13+ import { Link , LinkType } from '@/components/Link'
714import { SearchBar } from '@/components/SearchBar'
815import {
916 ArticleCard ,
@@ -24,32 +31,22 @@ import {
2431 SectionTitleDescription ,
2532 StickyMenu ,
2633} from '@/styles/styled'
27- import { CowFiCategory } from 'src/common/analytics/types'
28- import { Link , LinkType } from '@/components/Link'
29- import { CmsImage , Color , Media } from '@cowprotocol/ui'
30- import styled from 'styled-components/macro'
3134import { formatDate } from '@/util/formatDate'
35+ import { stripHtmlTags } from '@/util/stripHTMLTags'
36+ import { CowFiCategory } from 'src/common/analytics/types'
37+
3238import { useLazyLoadImages } from '../hooks/useLazyLoadImages'
33- import { useMemo } from 'react'
34- import ReactMarkdown from 'react-markdown'
35- import rehypeRaw from 'rehype-raw'
36- import { useCowAnalytics } from '@cowprotocol/analytics'
39+ import useWebShare from '../hooks/useWebShare'
40+ import { Article , SharedRichTextComponent } from '../services/cms'
3741
3842interface ArticlePageProps {
3943 article : Article
40- articles : Article [ ]
4144 randomArticles : Article [ ]
4245 featuredArticles : Article [ ]
4346 allCategories : { name : string ; slug : string } [ ]
4447}
4548
46- export function ArticlePageComponent ( {
47- articles,
48- article,
49- randomArticles,
50- featuredArticles,
51- allCategories,
52- } : ArticlePageProps ) {
49+ export function ArticlePageComponent ( { article, randomArticles, featuredArticles, allCategories } : ArticlePageProps ) {
5350 const attributes : {
5451 title ?: string
5552 description ?: string
@@ -183,7 +180,7 @@ export function ArticlePageComponent({
183180
184181 return (
185182 < li key = { article . id } >
186- < Link
183+ < a
187184 href = { `/learn/${ article . attributes ?. slug } ` }
188185 onClick = { ( ) =>
189186 analytics . sendEvent ( {
@@ -194,7 +191,7 @@ export function ArticlePageComponent({
194191 }
195192 >
196193 { articleTitle }
197- </ Link >
194+ </ a >
198195 </ li >
199196 )
200197 } ) }
@@ -322,7 +319,8 @@ function ArticleSharedRichTextComponent({ sharedRichText }: { sharedRichText: Sh
322319 return < LazyImage src = { src } alt = { alt || '' } { ...props } width = { 725 } height = { 400 } />
323320 } ,
324321 } }
325- children = { processedContent }
326- />
322+ >
323+ { processedContent }
324+ </ ReactMarkdown >
327325 )
328326}
0 commit comments