Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions src/renderer/src/components/Librarybar/main.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import { useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { eventBus } from '~/app/events'
import { useConfigState } from '~/hooks'
import { useGameRegistry } from '~/stores/game'
import { cn } from '~/utils'
import { GameList } from './GameList'
import { PositionButton } from './PositionButton'
import { useLibrarybarStore } from './store'
import { eventBus } from '~/app/events'
import { useEffect } from 'react'

export function Librarybar(): React.JSX.Element {
const [selectedGroup] = useConfigState('game.gameList.selectedGroup')
const query = useLibrarybarStore((state) => state.query)
const refreshGameList = useLibrarybarStore((state) => state.refreshGameList)
const gamesLoaded = useGameRegistry((state) => state.gamesLoaded)
const { t } = useTranslation('game')

console.warn(`[DEBUG] Librarybar`)

Expand All @@ -27,6 +31,19 @@ export function Librarybar(): React.JSX.Element {
}
}, [])

if (!gamesLoaded) {
return (
<div className={cn('flex flex-col gap-1 items-center justify-center w-full h-full -mt-7')}>
<div
className={cn(
'animate-spin w-8 h-8 border-2 border-primary border-t-transparent rounded-full'
)}
/>
<div className={cn('text-muted-foreground mt-2')}>{t('showcase.loadingGames')}</div>
</div>
)
Comment thread
fishyy119 marked this conversation as resolved.
}

return (
<div className={cn('flex flex-col gap-6 bg-transparent w-full h-full relative group shrink-0')}>
<div className={cn('p-0 w-full h-full')}>
Expand Down
Loading