import type { ItemSection } from "opvault.js"
import { parseMonthYear } from "../../utils"
import { Container } from "./Container"

export const MonthYear: React.FC<{ field: ItemSection.MonthYear }> = ({ field }) => {
  const { year, month } = parseMonthYear(field.v)
  return (
    <Container>
      {month.toString().padStart(2, "0")}/{year.toString().padStart(4, "0")}
    </Container>
  )
}
