caelum0x 2b68bde5d5 Predikt: full Polymarket-style prediction market — web + mobile + on-chain + bots
Working tree is now the canonical repo. Off-chain play-money + trustless on-chain
(FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution,
mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 23:29:50 +03:00

28 lines
712 B
TypeScript

import clsx from 'clsx'
import { useEffect, useState } from 'react'
import { getCountdownString } from 'client-common/lib/time'
export function Countdown(props: {
endDate: Date
className?: string
includeSeconds?: boolean
}) {
const { endDate, className, includeSeconds } = props
const [countdown, setCountdown] = useState('')
useEffect(() => {
setCountdown(getCountdownString(endDate, includeSeconds))
const intervalId = setInterval(() => {
setCountdown(getCountdownString(endDate, includeSeconds))
}, 1000)
return () => clearInterval(intervalId)
}, [endDate])
return (
<span suppressHydrationWarning className={clsx(className)}>
{countdown}
</span>
)
}