added base_url iamge

This commit is contained in:
Samandar Turgunboyev
2026-02-26 12:41:06 +05:00
parent 8aef5f8b18
commit 7fdf219d7f

View File

@@ -8,16 +8,15 @@ import { BASE_URL } from '@/shared/config/api/URLs';
import { Metadata } from 'next';
interface Props {
params: { locale: 'uz' | 'ru' };
params: { locale: 'uz' | 'ru' | 'en' };
}
export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { locale } = params;
const { locale } = await params; // Next.js 15 da params async
try {
const res = await partner_api.getAbout();
const data: AboutData = res.data;
const banner = data.banner;
const title =
@@ -35,8 +34,10 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
: banner.description_en;
const bannerUrl = banner.image
? BASE_URL + banner.image
? `${BASE_URL}${banner.image}`
: '/logos/logo.png';
const ogLocale =
locale === 'uz' ? 'uz_UZ' : locale === 'ru' ? 'ru_RU' : 'en_US';
return {
title: title || 'Gastro Market',
@@ -51,11 +52,11 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
{
url: bannerUrl,
width: 1200,
height: 1200,
height: 630,
alt: title || 'Gastro Market',
},
],
locale: locale === 'uz' ? 'uz_UZ' : 'ru_RU',
locale: ogLocale,
type: 'website',
},
twitter: {
@@ -75,11 +76,10 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
}
}
// Page component
const page = async () => {
// Page ham params olishi kerak
const AboutPage = async () => {
return (
<div className="custom-container">
{/* Hero va Content ichida React Query ishlatilgan loading + dynamic data */}
<AboutHero />
<AboutContent />
<PartnershipForm />
@@ -87,4 +87,4 @@ const page = async () => {
);
};
export default page;
export default AboutPage;