import React from 'react'
import {Link} from 'react-router-dom'
import {Message, Grid, Loader, Header, Item} from 'semantic-ui-react'
import {useObservable} from 'rxjs-hooks'
import {of, from} from 'rxjs'
import {map, switchMap} from 'rxjs/operators'
import {fromLonLat} from 'ol/proj'
import api from 'api'
import {Stats, Map, Page, RoadsLayer} from 'components'
import {TrackListItem} from './TracksPage'
import styles from './HomePage.module.scss'
function WelcomeMap() {
return (
)
}
function MostRecentTrack() {
const track: Track | null = useObservable(
() =>
of(null).pipe(
switchMap(() => from(api.fetch('/tracks?limit=1'))),
map((response) => response?.tracks?.[0])
),
null,
[]
)
return (
<>
{track === undefined ? (
No public tracks yet. Upload the first!
) : track ? (
) : null}
>
)
}
export default function HomePage() {
return (
)
}