(code: string)
| 32 | }; |
| 33 | |
| 34 | const highlightSyntax = (code: string) => { |
| 35 | const escaped = escapeHtml(code); |
| 36 | return escaped |
| 37 | .replace(/\b(query|mutation|subscription|fragment|type|input|interface|enum|scalar|union|schema|extend|implements)\b/g, '<span class="text-primary">$1</span>') |
| 38 | .replace(/\b(String|Int|Float|Boolean|ID|true|false|null)\b/g, '<span class="text-secondary">$1</span>') |
| 39 | .replace(/"([^"]*)"/g, '<span class="text-chart-1">"$1"</span>') |
| 40 | .replace(/#.*/g, '<span class="text-muted-foreground">$&</span>') |
| 41 | .replace(/\{|\}/g, '<span class="text-accent-foreground">$&</span>') |
| 42 | .replace(/\(|\)/g, '<span class="text-chart-2">$&</span>'); |
| 43 | }; |
| 44 | |
| 45 | return ( |
| 46 | <div className={`relative ${className}`}> |
no test coverage detected