import React from 'react'
import _ from 'lodash'
import {
Contract,
getHotContracts,
listAllContracts,
} from '../lib/firebase/contracts'
import { Spacer } from '../components/layout/spacer'
import { Page } from '../components/page'
import { Title } from '../components/title'
import { ActivityFeed } from './activity'
import { getRecentComments, Comment } from '../lib/firebase/comments'
import { Col } from '../components/layout/col'
import { ContractCard } from '../components/contract-card'
export async function getStaticProps() {
const [contracts, hotContracts, recentComments] = await Promise.all([
listAllContracts().catch((_) => []),
getHotContracts().catch(() => []),
getRecentComments().catch(() => []),
])
return {
props: {
contracts,
hotContracts,
recentComments,
},
revalidate: 60, // regenerate after a minute
}
}
const Home = (props: {
contracts: Contract[]
hotContracts: Contract[]
recentComments: Comment[]
}) => {
const { contracts, hotContracts, recentComments } = props
return (