2022-09-16 21:12:24 +00:00
|
|
|
import { ProbChangeTable } from 'web/components/contract/prob-change-table'
|
|
|
|
import { Col } from 'web/components/layout/col'
|
|
|
|
import { Page } from 'web/components/page'
|
|
|
|
import { Title } from 'web/components/title'
|
2022-09-22 21:57:48 +00:00
|
|
|
import { useProbChanges } from 'web/hooks/use-prob-changes'
|
2022-09-20 22:40:28 +00:00
|
|
|
import { useTracking } from 'web/hooks/use-tracking'
|
2022-09-16 21:12:24 +00:00
|
|
|
import { useUser } from 'web/hooks/use-user'
|
|
|
|
|
|
|
|
export default function DailyMovers() {
|
|
|
|
const user = useUser()
|
2022-09-20 22:40:28 +00:00
|
|
|
useTracking('view daily movers')
|
|
|
|
|
2022-09-16 21:12:24 +00:00
|
|
|
return (
|
|
|
|
<Page>
|
|
|
|
<Col className="pm:mx-10 gap-4 sm:px-4 sm:pb-4">
|
|
|
|
<Title className="mx-4 !mb-0 sm:mx-0" text="Daily movers" />
|
2022-09-29 16:42:16 +00:00
|
|
|
{user && <ProbChangesWrapper userId={user.id} />}
|
2022-09-16 21:12:24 +00:00
|
|
|
</Col>
|
|
|
|
</Page>
|
|
|
|
)
|
|
|
|
}
|
2022-09-29 16:42:16 +00:00
|
|
|
|
|
|
|
function ProbChangesWrapper(props: { userId: string }) {
|
|
|
|
const { userId } = props
|
|
|
|
|
|
|
|
const changes = useProbChanges({ bettorId: userId })?.filter(
|
|
|
|
(c) => Math.abs(c.probChanges.day) >= 0.01
|
|
|
|
)
|
|
|
|
|
|
|
|
return <ProbChangeTable changes={changes} full />
|
|
|
|
}
|