Skip to content

Commit

Permalink
feat: use createSkeletonArr helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
thoreyjona committed Sep 17, 2024
1 parent fa2dd6c commit 0482a9e
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
import { useBrowser } from '../../../lib/use-browser'
import { getApplicationUrl } from '../../../utils/applications-utils'
import { BottomTabsIndicator } from '../../../components/bottom-tabs-indicator/bottom-tabs-indicator'
import { createSkeletonArr } from '../../../utils/create-skeleton-arr'

type FlatListItem =
| Application
Expand Down Expand Up @@ -172,10 +173,7 @@ export const ApplicationsList = ({

const data = useMemo(() => {
if (applicationsRes.loading && !applicationsRes.data) {
return Array.from({ length: 5 }).map((_, id) => ({
id: String(id),
__typename: 'Skeleton',
}))
return createSkeletonArr(5)
}
if (applications.length === 0) {
return [{ id: '0', __typename: 'Empty' }]
Expand Down

0 comments on commit 0482a9e

Please sign in to comment.