mirror of
https://github.com/lux-tel/websites.git
synced 2026-10-30 20:31:36 +00:00
23 lines
663 B
TypeScript
23 lines
663 B
TypeScript
'use client';
|
|
|
|
import { PubKey, type PubKeyProps } from '@session/ui/components/PubKey';
|
|
import { forwardRef } from 'react';
|
|
import { useEnsName } from '../hooks/useEnsName';
|
|
|
|
export const PubkeyWithEns = forwardRef<HTMLDivElement, PubKeyProps>(
|
|
({ pubKey, expandOnHoverDesktopOnly, expandOnHover, ...props }, ref) => {
|
|
const { ensName, hasName } = useEnsName(pubKey);
|
|
|
|
return (
|
|
<PubKey
|
|
{...props}
|
|
ref={ref}
|
|
pubKey={pubKey}
|
|
pubKeyDisplayedOverride={ensName}
|
|
expandOnHover={hasName ? false : expandOnHover}
|
|
expandOnHoverDesktopOnly={hasName ? false : expandOnHoverDesktopOnly}
|
|
/>
|
|
);
|
|
}
|
|
);
|