28 lines
740 B
TypeScript
28 lines
740 B
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.',
|
|
},
|
|
};
|
|
|
|
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;
|
|
}
|