Add TOTP field support and restructured ItemFieldValues components

This commit is contained in:
aet
2022-02-21 02:55:35 -05:00
parent ac8745dbdc
commit 16575b6739
17 changed files with 271 additions and 162 deletions

View File

@ -0,0 +1,14 @@
import { useCallback } from "react"
import { useTranslate } from "../../i18n"
import { toast, ToastType } from "../Toast"
export function useCopy(text: string) {
const t = useTranslate()
return useCallback(() => {
navigator.clipboard.writeText(text)
toast({
type: ToastType.Secondary,
message: t.tips.copied_to_clipboard,
})
}, [text, t])
}