|
| 1 | +import { kebabCase } from 'lodash-es'; |
| 2 | +import type { MetadataRoute } from 'next'; |
| 3 | + |
| 4 | +import { BRANDING_LOGO_URL, BRANDING_NAME } from '@/const/branding'; |
| 5 | +import { manifestModule } from '@/server/manifest'; |
| 6 | +import { translation } from '@/server/translation'; |
| 7 | + |
| 8 | +const manifest = async (): Promise<MetadataRoute.Manifest | any> => { |
| 9 | + const { t } = await translation('metadata'); |
| 10 | + |
| 11 | + return manifestModule.generate({ |
| 12 | + description: t('chat.description', { appName: BRANDING_NAME }), |
| 13 | + icons: [ |
| 14 | + { |
| 15 | + purpose: 'any', |
| 16 | + sizes: '192x192', |
| 17 | + url: '/icons/icon-192x192.png', |
| 18 | + }, |
| 19 | + { |
| 20 | + purpose: 'maskable', |
| 21 | + sizes: '192x192', |
| 22 | + url: '/icons/icon-192x192.maskable.png', |
| 23 | + }, |
| 24 | + { |
| 25 | + purpose: 'any', |
| 26 | + sizes: '512x512', |
| 27 | + url: '/icons/icon-512x512.png', |
| 28 | + }, |
| 29 | + { |
| 30 | + purpose: 'maskable', |
| 31 | + sizes: '512x512', |
| 32 | + url: '/icons/icon-512x512.maskable.png', |
| 33 | + }, |
| 34 | + ], |
| 35 | + id: kebabCase(BRANDING_NAME), |
| 36 | + name: BRANDING_NAME, |
| 37 | + screenshots: BRANDING_LOGO_URL |
| 38 | + ? [] |
| 39 | + : [ |
| 40 | + { |
| 41 | + form_factor: 'narrow', |
| 42 | + url: '/screenshots/shot-1.mobile.png', |
| 43 | + }, |
| 44 | + { |
| 45 | + form_factor: 'narrow', |
| 46 | + url: '/screenshots/shot-2.mobile.png', |
| 47 | + }, |
| 48 | + { |
| 49 | + form_factor: 'narrow', |
| 50 | + sizes: '640x1138', |
| 51 | + |
| 52 | + url: '/screenshots/shot-3.mobile.png', |
| 53 | + }, |
| 54 | + { |
| 55 | + form_factor: 'narrow', |
| 56 | + url: '/screenshots/shot-4.mobile.png', |
| 57 | + }, |
| 58 | + { |
| 59 | + form_factor: 'narrow', |
| 60 | + url: '/screenshots/shot-5.mobile.png', |
| 61 | + }, |
| 62 | + { |
| 63 | + form_factor: 'wide', |
| 64 | + url: '/screenshots/shot-1.desktop.png', |
| 65 | + }, |
| 66 | + { |
| 67 | + form_factor: 'wide', |
| 68 | + url: '/screenshots/shot-2.desktop.png', |
| 69 | + }, |
| 70 | + { |
| 71 | + form_factor: 'wide', |
| 72 | + url: '/screenshots/shot-3.desktop.png', |
| 73 | + }, |
| 74 | + { |
| 75 | + form_factor: 'wide', |
| 76 | + url: '/screenshots/shot-4.desktop.png', |
| 77 | + }, |
| 78 | + { |
| 79 | + form_factor: 'wide', |
| 80 | + url: '/screenshots/shot-5.desktop.png', |
| 81 | + }, |
| 82 | + ], |
| 83 | + }); |
| 84 | +}; |
| 85 | + |
| 86 | +export default manifest; |
0 commit comments