import { CopyWithTooltip, Tooltip, VegaIcon, VegaIconNames, } from '@vegaprotocol/ui-toolkit'; import classNames from 'classnames'; import type { HTMLAttributes, ReactNode } from 'react'; import { Button } from './buttons'; import { useT } from '../../lib/use-t'; import { Routes } from '../../lib/links'; import { DApp, useLinks } from '@vegaprotocol/environment'; import truncate from 'lodash/truncate'; export const Tile = ({ className, children, }: HTMLAttributes) => { return (
{children}
); }; type StatTileProps = { title: ReactNode; testId?: string; description?: ReactNode; children?: ReactNode; overrideWithNoProgram?: boolean; }; export const StatTile = ({ title, description, children, testId, overrideWithNoProgram = false, }: StatTileProps) => { if (overrideWithNoProgram) { return ; } return (

{title}

{children}
{description && (
{description}
)}
); }; export const NoProgramTile = ({ title }: Pick) => { const t = useT(); return (

{title}

{t('No active program')}
); }; const FADE_OUT_STYLE = classNames( 'after:w-5 after:h-full after:absolute after:top-0 after:right-0', 'after:bg-gradient-to-l after:from-vega-clight-800 after:dark:from-vega-cdark-800 after:to-transparent' ); export const CodeTile = ({ code, createdAt, className, }: { code: string; createdAt?: string; className?: string; }) => { const t = useT(); const consoleLink = useLinks(DApp.Console); const applyCodeLink = consoleLink( `#${Routes.REFERRALS_APPLY_CODE}?code=${code}` ); return (
{code}
} >
{code}
{t('Copy shareable apply code link')} {': '} {truncate(applyCodeLink, { length: 32 })} } >
); };