chore(dev): cleanup

This commit is contained in:
Soumyadas15 2025-06-01 11:26:12 +05:30
parent 6d7211b139
commit b2a6361e2d
1 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,50 @@
import { headers } from 'next/headers';
import { ImageResponse } from 'next/og';
// Configuration exports
export const runtime = 'edge';
export const alt = 'Kortix Suna';
export const size = {
width: 1200,
height: 630,
};
export const contentType = 'image/png';
export default async function Image() {
try {
// Get the host from headers
const headersList = await headers();
const host = headersList.get('host') || '';
const protocol = process.env.NODE_ENV === 'development' ? 'http' : 'https';
const baseUrl = `${protocol}://${host}`;
return new ImageResponse(
(
<div
style={{
height: '100%',
width: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
background: 'black',
}}
>
<img
src={`${baseUrl}/meta.png`}
alt={alt}
style={{
width: '100%',
height: '100%',
objectFit: 'contain',
}}
/>
</div>
),
{ ...size },
);
} catch (error) {
console.error('Error generating OpenGraph image:', error);
return new Response(`Failed to generate image`, { status: 500 });
}
}