2023-02-06 13:27:28 -05:00
|
|
|
import React from 'react';
|
|
|
|
|
|
2023-02-07 19:07:48 -05:00
|
|
|
export default function NavLink({ svg, text, clickHandler }) {
|
|
|
|
|
const props = {
|
|
|
|
|
className:
|
|
|
|
|
'flex cursor-pointer items-center gap-3 rounded-md py-3 px-3 text-sm text-white transition-colors duration-200 hover:bg-gray-500/10'
|
|
|
|
|
};
|
2023-02-07 16:22:35 -05:00
|
|
|
|
2023-02-07 19:07:48 -05:00
|
|
|
if (clickHandler) {
|
|
|
|
|
props.onClick = clickHandler;
|
2023-02-08 00:02:29 -05:00
|
|
|
console.log('clickHandler: ', clickHandler);
|
2023-02-07 19:07:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<a {...props}>
|
|
|
|
|
{svg()}
|
|
|
|
|
{text}
|
|
|
|
|
</a>
|
|
|
|
|
);
|
2023-02-06 13:27:28 -05:00
|
|
|
}
|