We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent df2c9f1 commit 3b5e9d5Copy full SHA for 3b5e9d5
src/utils/device.ts
@@ -1,6 +1,21 @@
1
import type { Device } from '~/api/types'
2
3
+function deviceTypePretty(device: Device) {
4
+ switch (device.device_type) {
5
+ case 'threex':
6
+ return 'comma 3X'
7
+ case 'neo':
8
+ return 'EON'
9
+ case 'freon':
10
+ return 'freon'
11
+ case 'unknown':
12
+ return 'unknown'
13
+ default:
14
+ return `comma ${device.device_type}`
15
+ }
16
+}
17
+
18
export function getDeviceName(device: Device) {
19
if (device.alias) return device.alias
- return `comma ${device.device_type}`
20
+ return deviceTypePretty(device)
21
}
0 commit comments