improved seo, made not-found page, fixed bugs in news details and in report datails pages

This commit is contained in:
Alibek committed 2024-03-14 04:13:08 +06:00
1 parent 7d36510a9b
commit ad86f2e79e
18 files changed
+224 -30

No files matched your search

+23 -1
View File
@@ -7,11 +7,33 @@ import message from "./icons/message.svg";
import calendar from "./icons/calendar.svg";
import ReviewSection from "@/widgets/ReviewSection/ReviewSection";
import BreadCrumbs from "@/features/BreadCrumbs/BreadCrumbs";
import { Metadata } from "next";
export async function generateMetadata({
params,
}: {
params: { id: string };
}): Promise<Metadata> {
const response = await apiInstance.get<INews>(
`/news/${params.id}/`
);
return {
title: response.data.title,
description: response.data.description,
openGraph: {
images: [response.data.image],
type: "article",
publishedTime: response.data.created_at,
},
keywords: ["Новости КР", "Дорожные происшествия", "Кыргызстан"],
};
}
const NewsDetails = async ({
params,
}: {
params: { id: string };
params: { id: string; новость: string };
}) => {
const getNewsById = async () => {
const response = await apiInstance.get<INews>(