• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / codegate-ui / 12786408281

15 Jan 2025 10:30AM UTC coverage: 64.325% (-4.0%) from 68.304%
12786408281

Pull #70

github

web-flow
Merge 1ba419364 into b2446e3b9
Pull Request #70: Support dark mode

188 of 366 branches covered (51.37%)

Branch coverage included in aggregate %.

1 of 46 new or added lines in 2 files covered. (2.17%)

398 of 545 relevant lines covered (73.03%)

25.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/components/Help.tsx
1
import { useEffect, useState } from "react";
2
import { useParams } from "react-router-dom";
3
import { Markdown } from "./Markdown";
4
import Prism from "prismjs";
5
import "prismjs/themes/prism-tomorrow.css";
6
import "prismjs/components/prism-bash";
7
import "prismjs/components/prism-javascript";
8
import "prismjs/components/prism-python";
9
import "prismjs/components/prism-json";
10
import "prismjs/components/prism-yaml";
11

12
export function Help() {
13
  const { section } = useParams();
×
14
  const [content, setContent] = useState<string>("");
×
15

16
  useEffect(() => {
×
17
    const fetchContent = async () => {
×
18
      try {
×
19
        const response = await fetch(`/help/${section}.md`);
×
20
        if (!response.ok) {
×
21
          throw new Error("Failed to load content");
×
22
        }
23
        const text = await response.text();
×
24
        setContent(text);
×
25

26
        // Allow content to render before highlighting
27
        setTimeout(() => {
×
28
          Prism.highlightAll();
×
29
        }, 0);
30
      } catch (error) {
31
        console.error("Error loading help content:", error);
×
32
        setContent(
×
33
          "# Error\nFailed to load help content. Please try again later.",
34
        );
35
      }
36
    };
37

38
    fetchContent();
×
39
  }, [section]);
40

41
  return (
42
    <div className="max-w-5xl rounded-lg px-6 mx-auto">
43
      <Markdown
44
        className="prose prose-lg max-w-none
45
            prose-h1:text-3xl prose-h1:font-bold prose-h1:mb-8
46
            prose-h2:text-2xl prose-h2:font-semibold prose-h2:mt-8 prose-h2:mb-4
47
            prose-h3:text-xl prose-h3:font-medium prose-h3:mt-6 prose-h3:mb-3
48
             prose-p:leading-relaxed
49
            prose-pre:bg-gray-900 prose-pre:rounded-lg prose-pre:p-4
50
            prose-pre:shadow-md
51
          "
52
      >
53
        {content}
54
      </Markdown>
55
    </div>
56
  );
57
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc