This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import { useRef } from 'react'; | |
| import isEqual from 'lodash.isequal'; | |
| export function useDeepMemo<TValue>( | |
| value: TValue, | |
| isEqualFn: (a: TValue, b: TValue) => boolean = isEqual | |
| ): TValue { | |
| const ref = useRef<TValue>(value); | |
| // Update ref if the value has changed | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import {useMemo, useRef} from 'react'; | |
| export function useWhiteBlackList<TData, TFilter>( | |
| { | |
| whitelist: whitelistProp, | |
| blacklist: blacklistProp, | |
| list | |
| }: { | |
| whitelist?: Array<TFilter>; | |
| blacklist?: Array<TFilter>; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import {useEffect, useState} from 'react'; | |
| export function useStableArray<TType>( | |
| items?: Array<TType> | |
| ): Array<TType> | undefined { | |
| const [stableArray, setStableArray] = useState<Array<TType>>(items); | |
| useEffect(() => { | |
| if (JSON.stringify(items) !== JSON.stringify(stableArray)) { | |
| setStableArray(items); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import classNames from 'classnames'; | |
| import Prism from 'prismjs'; | |
| import {FC, useEffect, useMemo, useRef} from 'react'; | |
| import {ClassNameProps} from '../utils/withClassName'; | |
| import 'prismjs'; | |
| import 'prismjs/themes/prism-solarizedlight.css'; | |
| import 'prismjs/components/prism-shell-session'; | |
| import 'prismjs/components/prism-graphql'; | |
| import 'prismjs/components/prism-json'; | |
| import 'prismjs/components/prism-turtle'; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import {CircularProgress} from '@mui/material'; | |
| import {FC, PropsWithChildren} from 'react'; | |
| interface PendingOverlayProps { | |
| isPending: boolean; | |
| } | |
| export const PendingOverlay: FC<PropsWithChildren<PendingOverlayProps>> = ({ | |
| isPending, | |
| children | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import Prism from 'prismjs'; | |
| import {FC, useEffect, useMemo, useRef} from 'react'; | |
| interface JsonBlockProps { | |
| indent?: number; | |
| value: unknown; | |
| } | |
| export const JsonBlock: FC<JsonBlockProps> = ({indent, value}) => { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | export function trimPublicKey(publicKey: string, size: number): string { | |
| return publicKey.length <= size * 2 | |
| ? publicKey | |
| : `${publicKey.slice(0, size)}...${publicKey.slice(-size)}`; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | export function hashString(str: string): number { | |
| let hash = 0; | |
| for (let i = 0; i < str.length; i++) { | |
| hash = (hash << 5) - hash + str.charCodeAt(i); | |
| hash |= 0; // Convert to 32-bit integer | |
| } | |
| return Math.abs(hash); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import {type ClassValue, clsx} from 'clsx'; | |
| import {twMerge} from 'tailwind-merge'; | |
| export type PropsWithClassName<P = unknown> = P & { | |
| className?: ClassValue | undefined; | |
| }; | |
| export function cn(...inputs: ClassValue[]) { | |
| return twMerge(clsx(inputs)); | |
| } | 
NewerOlder