Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

paletteSearchCopy.ts

20 lines614 Bytes

1import { mFallback, msg } from "gt-i18n";
2import type { MFunctionType } from "gt-i18n/types";
3​
4import type { SearchMatchHintField } from "./paletteSearch.ts";
5​
6const MATCH_HINT_LABELS: Readonly<Record<SearchMatchHintField, string>> = {
7 "pull-request": msg("PR", { $context: "abbreviation of pull request" }),
8 branch: msg("Branch"),
9 project: msg("Project"),
10 environment: msg("Environment"),
11 reference: msg("ID or link"),
12};
13​
14/** @public */
15export function searchMatchHintLabel(
16 field: SearchMatchHintField,
17 resolve: MFunctionType = mFallback,
18): string {
19 return resolve(MATCH_HINT_LABELS[field]);