LibreChat/client/src/components/SidePanel/Parameters/OptionHover.tsx
Ruben Talstra 7f48030452
🔄 chore: Enforce 18next Language Keys (#5803)
* chore: enforcing language keys to adhere to the new standard.

* chore: enforcing i18n forbids to write plain text in JSX markup

* chore: enforcing i18n forbids to write plain text in JSX markup

* fix: ci with checkbox for unused keys :)

* refactor: removed all the unused `i18n` keys
2025-02-12 15:48:13 -05:00

39 lines
973 B
TypeScript

import React from 'react';
import { HoverCardPortal, HoverCardContent } from '~/components/ui';
import { TranslationKeys, useLocalize } from '~/hooks';
import { ESide } from '~/common';
type TOptionHoverProps = {
description: string;
langCode?: boolean;
sideOffset?: number;
disabled?: boolean;
side: ESide;
className?: string;
};
function OptionHover({
side,
description,
disabled,
langCode,
sideOffset = 30,
className,
}: TOptionHoverProps) {
const localize = useLocalize();
if (disabled) {
return null;
}
const text = langCode ? localize(description as TranslationKeys) : description;
return (
<HoverCardPortal>
<HoverCardContent side={side} className={`z-[999] w-80 ${className}`} sideOffset={sideOffset}>
<div className="space-y-2">
<p className="text-sm text-gray-600 dark:text-gray-300">{text}</p>
</div>
</HoverCardContent>
</HoverCardPortal>
);
}
export default OptionHover;