next.js/test/e2e/app-dir/metadata-dynamic-routes/app/gsp/icon.tsx
icon.tsx40 lines795 B
import { ImageResponse } from 'next/og'

export async function generateImageMetadata({ params }) {
  return [
    {
      contentType: 'image/png',
      size: { width: 48, height: 48 },
      id: 'small',
    },
    {
      contentType: 'image/png',
      size: { width: 72, height: 72 },
      id: 'medium',
    },
  ]
}

export default async function icon({ params, id }) {
  const { size } = await params
  const iconId = await id
  return new ImageResponse(
    (
      <div
        style={{
          width: '100%',
          height: '100%',
          display: 'flex',
          alignItems: 'center',
          justifyContent: 'center',
          fontSize: 88,
          background: '#fff',
          color: '#000',
        }}
      >
        Icon {size} {iconId}
      </div>
    )
  )
}
Quest for Codev2.0.0
/
SIGN IN