LibreChat/client/src/components/SidePanel/Builder/AssistantAction.tsx
Marco Beretta 0bd59c0efe
🎨 style: update Assistants builder (#3397)
* style: update Assistant builder

* fix(Eng): re-introduce old file_search info message

* feat: new OGDialogTemplate; style: imporved tools + actions dialogs

* style: fix alignment issue for delete tool dialog

* chore: import order

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
2024-07-21 13:46:43 -04:00

39 lines
1.1 KiB
TypeScript

import { useState } from 'react';
import type { Action } from 'librechat-data-provider';
import GearIcon from '~/components/svg/GearIcon';
export default function AssistantAction({
action,
onClick,
}: {
action: Action;
onClick: () => void;
}) {
const [isHovering, setIsHovering] = useState(false);
return (
<div>
<div
onClick={onClick}
className="flex w-full rounded-lg text-sm hover:cursor-pointer"
onMouseEnter={() => setIsHovering(true)}
onMouseLeave={() => setIsHovering(false)}
>
<div
className="h-9 grow whitespace-nowrap px-3 py-2"
style={{ textOverflow: 'ellipsis', wordBreak: 'break-all', overflow: 'hidden' }}
>
{action.metadata.domain}
</div>
{isHovering && (
<button
type="button"
className="transition-color flex h-9 w-9 min-w-9 items-center justify-center rounded-lg duration-200 hover:bg-gray-200 dark:hover:bg-gray-700"
>
<GearIcon className="icon-sm" />
</button>
)}
</div>
</div>
);
}