mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-08-29 01:08:59 +00:00
a9143b0fba
* ADD - build in-game admin command center * ADD - open admin panel by command * ENH - rebuild admin panel as standalone editor * ENH - compact admin workspace navigation * ENH - expand admin device controls * ENH - refine admin panel navigation style * ADD - add SQL phone configurator * FIX - expose complete phone configuration * FIX - make company jobs freely configurable * FIX - align configurator tables to left * ENH - organize configurator collection controls * ENH - organize nested configurator sections * ENH - add configurator field descriptions * FIX - hide fixed configurator add controls * ENH - refine configurator editing experience * ENH - refine admin configurator controls * FIX - apply configurator settings instantly * FIX - close live activity command registration --------- Co-authored-by: Leon.Schmidt <leonmauricewill15@gmail.com>
32 lines
930 B
TypeScript
32 lines
930 B
TypeScript
import type { BuiltinPhoneAppId } from '@/types/apps'
|
|
|
|
type PreviewableBuiltinAppId = Exclude<BuiltinPhoneAppId, 'app-store'>
|
|
|
|
const previewModules = import.meta.glob<string>(
|
|
'../assets/img/app-previews/*.jpg',
|
|
{
|
|
eager: true,
|
|
import: 'default',
|
|
query: '?url',
|
|
},
|
|
)
|
|
|
|
const APP_STORE_PREVIEW_IMAGES = Object.fromEntries(
|
|
Object.entries(previewModules).map(([path, imageUrl]) => {
|
|
const appId = path
|
|
.split('/')
|
|
.at(-1)
|
|
?.replace(/\.jpg$/, '')
|
|
if (!appId) throw new Error(`Invalid App Store preview path: ${path}`)
|
|
return [appId, imageUrl]
|
|
}),
|
|
) as Partial<Record<PreviewableBuiltinAppId, string>>
|
|
|
|
export function getAppStorePreviewImage(appId: string): string | null {
|
|
return APP_STORE_PREVIEW_IMAGES[appId as PreviewableBuiltinAppId] ?? null
|
|
}
|
|
|
|
export const APP_STORE_PREVIEW_IMAGE_IDS = Object.freeze(
|
|
Object.keys(APP_STORE_PREVIEW_IMAGES) as PreviewableBuiltinAppId[],
|
|
)
|