{"version":3,"sources":["../src/components/NetworkType.tsx"],"names":[],"mappings":";;;;AAeA,IAAM,cAAc,MAAM;AACxB,EAAA,MAAM,EAAE,WAAA,EAAY,GAAI,uBAAe,EAAE,QAAA,EAAU,MAAM,CAAA;AAEzD,EAAA,IAAI,KAAA,GAAQ,OAAA;AACZ,EAAA,IAAI,eAAe,IAAA,EAAM;AACvB,IAAA,KAAA,GAAQ,QAAA;AAAA,EACV,CAAA,MAAA,IAAW,gBAAgB,SAAA,EAAW;AACpC,IAAA,KAAA,GAAQ,OAAA;AAAA,EACV;AAIA,EAAA,2BACG,KAAA,EAAA,EAAM,KAAA,EAAqB,SAAA,EAAU,kBAAA,EACnC,yBAAe,cAAA,EAClB,CAAA;AAEJ,CAAA;AAEA,IAAO,mBAAA,GAAQ","file":"chunk-OCRJKDUB.mjs","sourcesContent":["import { Badge } from '@radix-ui/themes'\nimport useNetworkType from '~~/hooks/useNetworkType'\n\n/**\n * The `NetworkType` component renders the name of the currently selected network or disconnected if no wallet connected.\n *\n * It automatically re-fetches the network type from wallet every 3 seconds.\n * Every network is displayed in its own color:\n * - disconnected: tomato\n * - localnet/devnet/testnet: amber\n * - mainnet: green\n * Please note the user wallet is the single point of truth and the only way to switch the network now is through wallet settings.\n *\n * The component is using the useNetworkType hook to fetch the network type.\n */\nconst NetworkType = () => {\n  const { networkType } = useNetworkType({ autoSync: true })\n\n  let color = 'amber'\n  if (networkType == null) {\n    color = 'tomato'\n  } else if (networkType === 'mainnet') {\n    color = 'green'\n  }\n\n  // @todo Suggest Radix adding a better type for the color.\n  /* eslint-disable  @typescript-eslint/no-explicit-any */\n  return (\n    <Badge color={color as any} className=\"sk-network-badge\">\n      {networkType || 'disconnected'}\n    </Badge>\n  )\n}\n\nexport default NetworkType\n"]}