mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add getIconForListing helper
This commit is contained in:
parent
e8a34741bc
commit
251938a782
1 changed files with 20 additions and 0 deletions
|
|
@ -1,5 +1,10 @@
|
|||
// App Data that is derived from other app data
|
||||
|
||||
import {
|
||||
categories,
|
||||
categoryTemplate
|
||||
} from '~/helpers/categories.js'
|
||||
|
||||
export function isDevice ( listing ) {
|
||||
if ( !listing.hasOwnProperty('endpoint') ) return false
|
||||
|
||||
|
|
@ -71,3 +76,18 @@ export function getRouteType ( routeString ) {
|
|||
|
||||
return routeType
|
||||
}
|
||||
|
||||
export function getIconForListing ( listing ) {
|
||||
const routeType = getRouteType( listing.endpoint )
|
||||
|
||||
if ( routeType === 'tv' || routeType === 'benchmarks' ) return '📺'
|
||||
|
||||
if ( routeType === 'device' ) return '🖥'
|
||||
|
||||
if ( routeType === 'formula' ) return categories.homebrew.icon
|
||||
|
||||
if ( routeType === 'game' ) return categories.games.icon
|
||||
|
||||
// Just use default icon
|
||||
return categoryTemplate.icon
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue