Add TOTP field support and restructured ItemFieldValues components
This commit is contained in:
12
packages/web/src/components/ItemFieldValue/MonthYear.tsx
Normal file
12
packages/web/src/components/ItemFieldValue/MonthYear.tsx
Normal file
@ -0,0 +1,12 @@
|
||||
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>
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user