import { createPoll } from "ags/time"

export default function Prompt() {
  const cursor = createPoll("_", 600, () => {
    // alternate between _ and empty to create blink
    return Date.now() % 1200 < 600 ? "_" : " "
  })

  return (
    <box>
      <label class="prompt-name" label="tetardtek" />
      <label class="prompt-cursor" label={cursor} />
    </box>
  )
}
