import RelativeTime from '@yaireo/relative-time' import { LazyMotion, domAnimation, m, useReducedMotion } from 'framer-motion' import { useLocation } from '../../hooks/useLocation' import { getAnimationProps, moveInTop } from '../Transitions' import { Flag } from './Flag' import styles from './index.module.css' export default function Location() { const { now, next } = useLocation() const shouldReduceMotion = useReducedMotion() const isDifferentCountry = now?.country !== next?.country const relativeTime = new RelativeTime({ locale: 'en' }) return now?.city ? ( {now?.city} Now
{next?.city && ( <> {isDifferentCountry && ( )} {next.city}{' '} {relativeTime.from(new Date(next.date_start))} )}
) : null }