summaryrefslogtreecommitdiff
path: root/frontend/src/utils/pluginHelpers.ts
blob: a23f801ed176e99ba93f71aeecdc1fb20416fe9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/**
 * Returns a formatted display name for a plugin with version if available
 * @param name - The plugin name
 * @param version - The optional plugin version
 *
 * @returns Formatted string like "PluginName (v1.2.3)" or just "PluginName" if version is undefined
 */
export function getPluginDisplayName(name: string, version?: string): string {
  if (version) {
    return `${name} (v${version})`;
  }

  return name;
}