mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-31 15:48:51 +01:00
* fix: cursor pointer not applying correct in the root component * fix: add cursor-not-allowed to disabled state in SendButton component * feat: update Dropdown to ariakit and changed LLM error's style * feat: switched to ariakit's Dropdown and style improvements * feat: archive updates * refactor: delete conversations in archive * refactor: settings * add cool settings animation * a11y: settings update * style: update settings * style: settings account settings menu; a11y(AccountSettings): switched to AriaKit * a11y: account settings update * style: update my files dialog * fix: tests * chore: remove console.log() --------- Co-authored-by: Danny Avila <danny@librechat.ai>
39 lines
958 B
TypeScript
39 lines
958 B
TypeScript
import React, { FC, forwardRef } from 'react';
|
|
import { cn } from '~/utils/';
|
|
|
|
interface Props {
|
|
svg: () => JSX.Element;
|
|
text: string;
|
|
clickHandler?: React.MouseEventHandler<HTMLButtonElement>;
|
|
className?: string;
|
|
disabled?: boolean;
|
|
}
|
|
|
|
const NavLink: FC<Props> = forwardRef<HTMLButtonElement, Props>((props, ref) => {
|
|
const { svg, text, clickHandler, disabled, className = '' } = props;
|
|
const defaultProps: {
|
|
className: string;
|
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
} = {
|
|
className: cn(
|
|
'w-full flex gap-2 rounded p-2.5 text-sm cursor-pointer group items-center transition-colors duration-200 text-text-primary',
|
|
className,
|
|
{
|
|
'opacity-50 pointer-events-none': disabled,
|
|
},
|
|
),
|
|
};
|
|
|
|
if (clickHandler) {
|
|
defaultProps.onClick = clickHandler;
|
|
}
|
|
|
|
return (
|
|
<button {...defaultProps} ref={ref}>
|
|
{svg()}
|
|
{text}
|
|
</button>
|
|
);
|
|
});
|
|
|
|
export default NavLink;
|