import { twMerge } from 'tailwind-merge'; import { Link, useNavigate } from '@remix-run/react'; import { tv } from 'tailwind-variants'; import * as Table from './Table'; import { ArrowNarrowRight } from '../icons/ArrowNarrowRight'; import type { LinkProps } from '@remix-run/react'; import type { ComponentPropsWithoutRef, ComponentPropsWithRef } from 'react'; import type { ClientApp } from '../types'; import type { VariantProps } from 'tailwind-variants'; const appBar = tv({ variants: { color: { 1: 'bg-grey-300', 2: 'bg-green', 3: 'bg-blue-brand', 4: 'bg-brown', 5: 'bg-purple', 6: 'bg-red', 7: 'bg-green-dark', 8: 'bg-blue-dark', 9: 'bg-brown-dark', 10: 'bg-purple-dark', 11: 'bg-red-dark', 12: 'bg-green-light', 13: 'bg-blue-light', 14: 'bg-brown-light', 15: 'bg-purple-light', 16: 'bg-red-light', }, }, }); type AppColorBarProps = ComponentPropsWithoutRef<'div'> & VariantProps; function AppColorBar({ className, color, ...other }: AppColorBarProps) { return
; } function ExploreLink({ className, ...other }: LinkProps) { return ( Explore ); } function Tr({ pathname, ...other }: ComponentPropsWithoutRef & { pathname: string }) { const navigate = useNavigate(); return ( { if (event.metaKey || event.ctrlKey) { //open in new tab window.open(`/app/${pathname}`, '_blank'); } else { navigate(`/app/${pathname}`); } }} /> ); } type AppsTableProps = ComponentPropsWithRef & { data: ClientApp[]; }; //Once we have more advance scenarios use @tanstack/react-table here export function AppsTable({ data, ...other }: AppsTableProps) { return ( Apps On-chain tag {data.map(({ id, name, brandColor, onChainTag }, index) => (
{/* I don't know why TS complains here */} {/* @ts-ignore-next-line */} {name}
{onChainTag?.name ? onChainTag.name : '-'} ))}
); }