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

stacklok / codegate-ui / 13009694127

28 Jan 2025 11:44AM UTC coverage: 68.305%. Remained the same
13009694127

Pull #205

github

web-flow
Merge a7005bc73 into d49c0fbdc
Pull Request #205: chore(deps-dev): bump @testing-library/user-event from 14.6.0 to 14.6.1

344 of 605 branches covered (56.86%)

Branch coverage included in aggregate %.

768 of 1023 relevant lines covered (75.07%)

66.73 hits per line

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

0.0
/src/hooks/useHelpContent.ts
1
import { useQuery } from "@tanstack/react-query";
2
import Prism from "prismjs";
3

4
const fetchHelpContent = async (
×
5
  section: string | undefined,
6
): Promise<string> => {
7
  if (!section) {
×
8
    throw new Error("Section is required");
×
9
  }
10

11
  const response = await fetch(`/help/${section}.md`);
×
12
  if (!response.ok) {
×
13
    throw new Error("Failed to load content");
×
14
  }
15

16
  return response.text();
×
17
};
18

19
export const useHelpContent = (section: string | undefined) => {
×
20
  return useQuery({
×
21
    queryKey: ["helpContent", section],
22
    queryFn: () => fetchHelpContent(section),
×
23
    enabled: !!section,
24
    staleTime: 0,
25
    select: (data) => {
26
      // Allow content to render before highlighting
27
      setTimeout(() => {
×
28
        Prism.highlightAll();
×
29
      }, 0);
30
      return data;
×
31
    },
32
  });
33
};
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