56 lines
1.5 KiB
TypeScript
56 lines
1.5 KiB
TypeScript
import type { ResolvedApp } from './types';
|
|
|
|
const PRESENTATION: Record<string, { title: string; description: string }> = {
|
|
'de.add-ideas.pdf-tools': {
|
|
title: 'PDF',
|
|
description: 'Arrange PDF pages locally.',
|
|
},
|
|
'de.add-ideas.xslt-tools': {
|
|
title: 'XSLT',
|
|
description: 'Transform XML locally.',
|
|
},
|
|
'de.add-ideas.onenote-tools': {
|
|
title: 'OneNote',
|
|
description: 'Open OneNote files locally.',
|
|
},
|
|
'de.add-ideas.av-tools': {
|
|
title: 'Audio & Video',
|
|
description: 'Convert and edit locally.',
|
|
},
|
|
'de.add-ideas.regex-tools': {
|
|
title: 'Regex',
|
|
description: 'Explain and test locally.',
|
|
},
|
|
'de.add-ideas.svg-tools': {
|
|
title: 'SVG',
|
|
description: 'Inspect and edit vectors locally.',
|
|
},
|
|
'de.add-ideas.auth-tools': {
|
|
title: 'OTP & Passkeys',
|
|
description: 'Inspect and test authentication locally.',
|
|
},
|
|
'de.add-ideas.sudoku-tools': {
|
|
title: 'Sudoku',
|
|
description: 'Set, play and solve locally.',
|
|
},
|
|
'de.add-ideas.colour-tools': {
|
|
title: 'Colour',
|
|
description: 'Convert and build colours locally.',
|
|
},
|
|
'de.add-ideas.office-tools': {
|
|
title: 'Office',
|
|
description: 'Open office files locally.',
|
|
},
|
|
};
|
|
|
|
export function shortToolTitle(app: ResolvedApp): string {
|
|
return (
|
|
PRESENTATION[app.id]?.title ??
|
|
app.name.replace(/\s+(?:reader|tools?|workbench)$/iu, '')
|
|
);
|
|
}
|
|
|
|
export function shortToolDescription(app: ResolvedApp): string {
|
|
return PRESENTATION[app.id]?.description ?? app.description;
|
|
}
|