mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 10:50:14 +01:00
27 lines
774 B
TypeScript
27 lines
774 B
TypeScript
|
|
import React from 'react';
|
||
|
|
import { HoverCardPortal, HoverCardContent } from '~/components/ui';
|
||
|
|
import { useLocalize } from '~/hooks';
|
||
|
|
import { ESide } from '~/common';
|
||
|
|
|
||
|
|
type TOptionHoverProps = {
|
||
|
|
description: string;
|
||
|
|
langCode?: boolean;
|
||
|
|
side: ESide;
|
||
|
|
};
|
||
|
|
|
||
|
|
function OptionHover({ side, description, langCode }: TOptionHoverProps) {
|
||
|
|
const localize = useLocalize();
|
||
|
|
const text = langCode ? localize(description) : description;
|
||
|
|
return (
|
||
|
|
<HoverCardPortal>
|
||
|
|
<HoverCardContent side={side} className="z-[999] w-80 dark:bg-gray-700" sideOffset={30}>
|
||
|
|
<div className="space-y-2">
|
||
|
|
<p className="text-sm text-gray-600 dark:text-gray-300">{text}</p>
|
||
|
|
</div>
|
||
|
|
</HoverCardContent>
|
||
|
|
</HoverCardPortal>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
export default OptionHover;
|