MCPcopy
hub / github.com/colinhacks/zod / If

Function If

packages/docs/components/if.tsx:3–11  ·  view source on GitHub ↗
(props: { groupId: string; values: string[]; children: any })

Source from the content-addressed store, hash-verified

1"use client";
2
3export function If(props: { groupId: string; values: string[]; children: any }) {
4 if (typeof window === "undefined") return null;
5 // read key from localstorage
6 const value = window.localStorage.getItem(props.groupId);
7 // if key is in values, return children
8 if (value && props.values.includes(value)) {
9 return props.children;
10 }
11}

Callers

nothing calls this directly

Calls 1

includesMethod · 0.65

Tested by

no test coverage detected