Function
If
(props: { groupId: string; values: string[]; children: any })
Source from the content-addressed store, hash-verified
| 1 | "use client"; |
| 2 | |
| 3 | export 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
Tested by
no test coverage detected