MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / AnalyticsGroup

Function AnalyticsGroup

apps/web/ui/NavBar/Desktop/AnalyticsGroup/index.tsx:16–41  ·  view source on GitHub ↗
({
  currentUser,
  currentUrl,
  permissions,
  paths,
  Link,
}: Props)

Source from the content-addressed store, hash-verified

14}
15
16export default function AnalyticsGroup({
17 currentUser,
18 currentUrl,
19 permissions,
20 paths,
21 Link,
22}: Props) {
23 const [show, toggle] = useState(false);
24 if (!currentUser || !permissions.manage) {
25 return null;
26 }
27 return (
28 <>
29 <Nav.Group onClick={() => toggle((show) => !show)}>
30 Analytics {show ? <FiChevronUp /> : <FiChevronDown />}
31 </Nav.Group>
32 {show && (
33 <Link href="/metrics">
34 <Nav.Item active={paths.metrics === currentUrl}>
35 <FiBarChart /> Metrics
36 </Nav.Item>
37 </Link>
38 )}
39 </>
40 );
41}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected