import h from '../shared/h.js'
import formatTime from '../shared/format-time.js'

export function Time ({ _time, ...props }) {
  const date = new Date(_time || Date.now())
  return h('time', {
    ...props,
    className: 'block text-txa/80',
    datetime: date.toISOString(),
    children: formatTime(date)
  })
}
