mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-13 23:59:16 +03:00
34 lines
607 B
TypeScript
34 lines
607 B
TypeScript
import type { ReactNode } from "react";
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
export const INLINE_TOKEN_HIGHLIGHT_COLOR = "var(--inline-token-highlight)";
|
|
|
|
export function InlineTokenHighlight({
|
|
children,
|
|
className,
|
|
color,
|
|
testId,
|
|
title,
|
|
}: {
|
|
children: ReactNode;
|
|
className?: string;
|
|
color: string;
|
|
testId?: string;
|
|
title?: string;
|
|
}) {
|
|
return (
|
|
<span
|
|
data-testid={testId}
|
|
title={title}
|
|
className={cn(
|
|
"relative inline font-[550] transition-colors duration-150",
|
|
className,
|
|
)}
|
|
style={{ color }}
|
|
>
|
|
{children}
|
|
</span>
|
|
);
|
|
}
|