import type {MetadataRoute} from 'next';

/**
 * PWA install metadata. Next serves this at /manifest.webmanifest and injects
 * the <link rel="manifest"> itself — no tag to hand-write in the layout.
 *
 * The tab/apple-touch icons come from the app-dir file conventions instead
 * (favicon.ico, icon.png, apple-icon.png); these entries are only what the
 * installer and launcher use. `maskable` is a separate file rather than a
 * second purpose on the same one: launchers crop a maskable icon to their own
 * shape, so the heart is inset into the 80% safe zone in that copy only.
 */
export default function manifest(): MetadataRoute.Manifest {
  return {
    name: 'Loyaly Merchant OS',
    short_name: 'Loyaly',
    description:
      'Footfall, campaign and LYT redemption analytics for Loyaly merchants.',
    start_url: '/dashboard',
    display: 'standalone',
    background_color: '#000000',
    theme_color: '#000000',
    icons: [
      {src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png', purpose: 'any'},
      {src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any'},
      {
        src: '/icons/icon-maskable-512.png',
        sizes: '512x512',
        type: 'image/png',
        purpose: 'maskable',
      },
    ],
  };
}
