import type { FocusEvent } from 'react' import React, { useCallback } from 'react' import type { PasswordInputProps } from '@toptal/picasso-password-input' import { PasswordInput as PicassoPasswordInput } from '@toptal/picasso-password-input' interface FieldRendererProps extends PasswordInputProps { onShowContent: () => void onHideContent: () => void } const FieldRenderer = (props: FieldRendererProps) => { const { onFocus, onBlur, onShowContent, onHideContent, ...rest } = props const handleFocus = useCallback( (event: FocusEvent) => { onFocus?.(event) onShowContent() }, [onFocus, onShowContent] ) const handleBlur = useCallback( (event: FocusEvent) => { onBlur?.(event) onHideContent() }, [onBlur, onHideContent] ) return ( ) } export default FieldRenderer