import { json, redirect } from '@remix-run/node'; import { Outlet, useLoaderData } from '@remix-run/react'; import { twMerge } from 'tailwind-merge'; import { Badge, isBadgeColor } from '../components/Badge'; import { LinkButton } from '../components/Button'; import { Key2 } from '../icons/Key2'; import { Settings4 } from '../icons/Settings4'; import { GoToExplorer } from '../components/GoToExplorer'; import { SwapCodeBlock } from '../components/SwapCodeBlock'; import { getAppById } from '../data/zippo.server'; import type { LoaderArgs, MetaFunction } from '@remix-run/node'; import type { ComponentPropsWithoutRef } from 'react'; import type { ClientApp } from '../types'; import { ZIPPO_ROUTE_TAG_TO_PRODUCT } from '../utils/utils'; import type { TZippoRouteTag } from 'zippo-interface'; export const meta: MetaFunction = ({ data }) => { return { title: `${data.app.name} Dashboard | 0x`, description: `${data.app.name} Dashboard`, }; }; export const loader = async ({ params, request }: LoaderArgs) => { if (!params.appId) throw redirect('/apps'); const app = await getAppById(params.appId); if (app.result === 'ERROR') { throw app.error; } return json({ app: app.data, }); }; function ViewDocsLink({ className, ...other }: ComponentPropsWithoutRef<'a'>) { return ( View docs ); } export type AppOutletContext = { app: ClientApp; }; export default function AppDashboard() { const { app } = useLoaderData(); return ( <>

{app.name}

{app.onChainTag?.name && ( {app.onChainTag.name} )}
{(app.productAccess || []).map((product: string) => { const { name, color } = ZIPPO_ROUTE_TAG_TO_PRODUCT[product as TZippoRouteTag] || {}; if (!name || !color) { console.warn('Invalid product', product); return null; } const badgeColor = isBadgeColor(color) ? color : undefined; if (badgeColor) { console.warn('Invalid color for Badge', color); } return ( {name} ); })}
} className="mr-4" to={`/app/${app.id}/api-key`} > API Key } to={`/app/${app.id}/settings`} > Settings

Make a live API call

Make your first live request with your API key.

Build a gasless dApp

Gasless dApp

Try Limit orders

Limit order
); }