diff --git a/src/app/[locale]/news/[id]/page.tsx b/src/app/[locale]/news/[id]/page.tsx index 249bdd2..25a749b 100644 --- a/src/app/[locale]/news/[id]/page.tsx +++ b/src/app/[locale]/news/[id]/page.tsx @@ -14,9 +14,7 @@ export async function generateMetadata({ }: { params: { id: string }; }): Promise { - const response = await apiInstance.get( - `/news/${params.id}/` - ); + const response = await apiInstance.get(`/news/${params.id}/`); return { title: response.data.title, @@ -28,6 +26,9 @@ export async function generateMetadata({ }, }; } +const formatDescription = (text: string) => { + return text.replace(/(\r\n|\n|\r)/g, "
"); +}; const NewsDetails = async ({ params, @@ -35,9 +36,7 @@ const NewsDetails = async ({ params: { id: string; новость: string }; }) => { const getNewsById = async () => { - const response = await apiInstance.get( - `/news/${params.id}/` - ); + const response = await apiInstance.get(`/news/${params.id}/`); return response.data; }; @@ -71,9 +70,9 @@ const NewsDetails = async ({ Calendar Icon

{months[data.created_at.slice(5, 7)]}{" "} - {data.created_at.slice(5, 7).slice(0, 1) === "0" - ? data.created_at.slice(6, 7) - : data.created_at.slice(5, 7)} + {data.created_at.slice(8, 10) === "0" + ? data.created_at.slice(9, 10) + : data.created_at.slice(8, 10)} , {data.created_at.slice(0, 4)}

@@ -87,7 +86,12 @@ const NewsDetails = async ({

{data.title}

-

{data.description}

+