Add TOTP field support and restructured ItemFieldValues components
This commit is contained in:
8
packages/web/src/components/ItemFieldValue/DateView.tsx
Normal file
8
packages/web/src/components/ItemFieldValue/DateView.tsx
Normal file
@ -0,0 +1,8 @@
|
||||
import type { ItemSection } from "opvault.js"
|
||||
import { useMemo } from "react"
|
||||
import { Container } from "./Container"
|
||||
|
||||
export const DateView: React.FC<{ field: ItemSection.Date }> = ({ field }) => {
|
||||
const date = useMemo(() => new Date(field.v * 1000), [field.v])
|
||||
return <Container>{date.toLocaleDateString()}</Container>
|
||||
}
|
Reference in New Issue
Block a user