import React, { CSSProperties } from 'react'; import { classnames } from '..'; interface Props { handling: () => void; children: React.ReactNode; className?: string[] | string; style?: CSSProperties; title?: string; } export function Lenke(props: Props) { const { handling, children, className, ...rest } = props; const keyhandler = (event) => { if (event.keyCode === 13 || event.keyCode === 32) { event.preventDefault(); handling(); } }; return ( handling()} onKeyDown={keyhandler} > {children} ); }