2023-12-15 17:34:50 +03:00
|
|
|
import clsx from 'clsx';
|
|
|
|
|
2023-07-15 17:46:19 +03:00
|
|
|
interface NavigationButtonProps {
|
2023-08-16 10:11:22 +03:00
|
|
|
id?: string
|
2023-08-26 19:39:49 +03:00
|
|
|
text?: string
|
2023-07-15 17:46:19 +03:00
|
|
|
icon: React.ReactNode
|
2023-08-16 10:11:22 +03:00
|
|
|
description?: string
|
|
|
|
onClick?: () => void
|
2023-07-15 17:46:19 +03:00
|
|
|
}
|
|
|
|
|
2023-08-26 19:39:49 +03:00
|
|
|
function NavigationButton({ id, icon, description, onClick, text }: NavigationButtonProps) {
|
2023-07-15 17:46:19 +03:00
|
|
|
return (
|
2023-12-05 01:22:44 +03:00
|
|
|
<button id={id} type='button' tabIndex={-1}
|
|
|
|
title={description}
|
|
|
|
onClick={onClick}
|
2023-12-15 17:34:50 +03:00
|
|
|
className={clsx(
|
|
|
|
'mr-1 h-full',
|
|
|
|
'flex items-center gap-1',
|
|
|
|
'clr-btn-nav',
|
|
|
|
'small-caps whitespace-nowrap',
|
|
|
|
{
|
|
|
|
'px-2': text,
|
|
|
|
'px-4': !text
|
|
|
|
}
|
|
|
|
)}
|
2023-12-05 01:22:44 +03:00
|
|
|
>
|
|
|
|
{icon ? <span>{icon}</span> : null}
|
|
|
|
{text ? <span className='font-semibold'>{text}</span> : null}
|
|
|
|
</button>);
|
2023-07-15 17:46:19 +03:00
|
|
|
}
|
|
|
|
|
2023-12-15 17:34:50 +03:00
|
|
|
export default NavigationButton;
|