UNPKG

@1771technologies/lytenyte-pro

Version:

Blazingly fast headless React data grid with 100s of features.

21 lines (20 loc) 630 B
import { jsx as _jsx } from "react/jsx-runtime"; const tokenToSyntaxColor = { Number: "number", String: "string", TemplateLiteral: "string", DateLiteral: "date", Spread: "operator", Punctuation: "operator", Pipe: "operator", Operator: "operator", Arrow: "operator", Identifier: "identifier", QuotedIdentifier: "identifier", ExpressionError: "error", Unparsed: "punctuation", }; export function DefaultTokenHighlighter({ token }) { const expr = tokenToSyntaxColor[token.type]; return _jsx("span", { style: { color: `var(--ln-expr-${expr})` }, children: token.value }); }