Add TOTP field support and restructured ItemFieldValues components
This commit is contained in:
19
packages/web/src/components/ItemFieldValue/Text.tsx
Normal file
19
packages/web/src/components/ItemFieldValue/Text.tsx
Normal file
@ -0,0 +1,19 @@
|
||||
import { useItemFieldContextMenu } from "../ItemFieldContextMenu"
|
||||
import { Container } from "./Container"
|
||||
import { useCopy } from "./hooks"
|
||||
|
||||
export const TextView: React.FC<{ value: string }> = ({ value }) => {
|
||||
const { onRightClick, ContextMenuContainer, Item } = useItemFieldContextMenu()
|
||||
const onCopy = useCopy(value)
|
||||
|
||||
return (
|
||||
<>
|
||||
<Container onContextMenu={onRightClick} onClick={onCopy}>
|
||||
{value}
|
||||
</Container>
|
||||
<ContextMenuContainer>
|
||||
<Item onClick={onCopy}>Copier</Item>
|
||||
</ContextMenuContainer>
|
||||
</>
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user