import type { ComponentProps, ReactNode } from "react"; import type { StateType, States } from "../../hooks/use-api"; import { StateType as DataStateType, useData } from "../../hooks/use-data"; import { tokensToString } from "../../tokens"; import { Link } from "../Link"; import { ModalDialog } from "../ModalDialog"; import { Tokens } from "../Tokens"; const ONE_SECOND_IN_MS = 1000; const ONE_MINUTE_IN_MS = 60 * ONE_SECOND_IN_MS; const REFRESH_INTERVAL = 1 * ONE_MINUTE_IN_MS; type Props = Omit, "title" | "children"> & { api: States[StateType.Loaded] | States[StateType.LoadedNoStakeAccount]; }; export const ProgramParameters = ({ api, ...props }: Props) => { const data = useData(api.dashboardDataCacheKey, api.loadData, { refreshInterval: REFRESH_INTERVAL, }); return ( See the current program parameters. For more details, see{" "} the docs } {...props} > ); }; type ParameterProps = { value: ReactNode; variable: ReactNode; children: ReactNode; }; const Parameter = ({ variable, value, children }: ParameterProps) => (
  • {variable}
    {value}

    {children}

  • ); const Loading = () => (
    );