You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
868 B
32 lines
868 B
import React, { FC, useEffect } from 'react'
|
|
import { useSelector, useDispatch } from 'react-redux'
|
|
|
|
import { fetchApps } from 'src/actions/apps'
|
|
import { getApps } from 'src/selectors/apps'
|
|
import { setTitle } from 'src/utils'
|
|
import { AppState, AppThunkDispatch, App } from 'src/types'
|
|
|
|
import PageHeader from 'src/components/page-header'
|
|
import AppListItem from 'src/components/app-list-item'
|
|
|
|
const Apps: FC = () => {
|
|
const apps = useSelector<AppState, App[]>(getApps)
|
|
const dispatch = useDispatch<AppThunkDispatch>()
|
|
|
|
useEffect(() => {
|
|
dispatch(fetchApps())
|
|
setTitle('Apps')
|
|
}, [])
|
|
|
|
return (
|
|
<div>
|
|
<PageHeader title="Apps" />
|
|
|
|
<div className="main-content">
|
|
{apps.map(app => <AppListItem key={app.id} app={app} />)}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default Apps
|