Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

9.5 KB
Raw Blame
import { cn } from '@/lib/utils';

export function UseCaseDoodle({
  id,
  delayMs = 0,
  className,
}: {
  id: string;
  delayMs?: number;
  className?: string;
}) {
  const paths = DOODLE_PATHS[id] ?? FALLBACK_DOODLE;
  const tilt = TILTS[hashId(id) % TILTS.length];

  return (
    <span
      className={cn(
        'inline-flex shrink-0 transition-transform duration-300 group-hover:-rotate-2 group-hover:scale-110',
        className,
      )}
    >
      <svg
        viewBox="0 0 48 48"
        fill="none"
        stroke="currentColor"
        strokeWidth={2}
        strokeLinecap="round"
        strokeLinejoin="round"
        aria-hidden
        className="size-full"
        style={{ transform: `rotate(${tilt}deg)` }}
      >
        {paths.map((d, i) => (
          <path
            key={i}
            d={d}
            pathLength={1}
            style={{ animationDelay: `${delayMs + i * 130}ms` }}
          />
        ))}
      </svg>
    </span>
  );
}

export function DoodleArrow({ className }: { className?: string }) {
  return (
    <svg
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth={2.4}
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden
      className={cn('shrink-0', className)}
    >
      <path d="M18.3 5.8c.2 2.9.3 5.5.1 7.8-.1 1.4-.9 2.1-2.3 2.2-3.4.2-6.9.2-10.4.1" />
      <path d="M5.7 15.9c1.3-1 2.5-2.1 3.6-3.4M5.7 15.9c1.2 1.2 2.6 2.2 4 3.1" />
    </svg>
  );
}

function hashId(id: string): number {
  let hash = 0;
  for (let i = 0; i < id.length; i++) {
    hash = (hash * 31 + id.charCodeAt(i)) >>> 0;
  }
  return hash;
}

function resolveTheme(id: string): UseCaseTheme {
  return INKS[CARD_INKS[id] ?? 'purple'];
}

const TILTS = [-3, -2, 2, -2.5, 1.5, 3, -1.5];

const FALLBACK_DOODLE: string[] = [
  'M24 8.5c.2 3.4.2 6.9.1 10.3M24 29.2c.2 3.4.2 6.9.1 10.3M8.5 24c3.4-.2 6.9-.2 10.3-.1M29.2 24c3.4-.2 6.9-.2 10.3-.1',
];

const DOODLE_PATHS: Record<string, string[]> = {
  'fill-pipeline': [
    'M8.5 12.3c10.4-.9 20.9-.8 30.9.2l-11.2 12.8.3 10.6-8.3-4.8.2-6.2z',
    'M17.5 4.5l-.4 3.4M24.2 3.4l-.1 3.5M30.7 4.6l.4 3.3',
  ],
  'close-deals': [
    'M8.5 27.5c2.8-5.8 4.9-8.7 6.4-8.2 1.9.6-2.6 9.3-.6 9.8 2.1.5 4.6-7.3 6.6-7 1.9.3-1.1 6.6.7 7.1 2.3.6 4.1-4.2 6.6-5.6',
    'M7.5 34.5c8.6-1.6 24.4-1.8 33-.6',
    'M35.5 27.5l3.6 3.8M39.3 27.3l-3.9 4.1',
  ],
  'take-from-rivals': [
    'M15.6 40.5c-.5-10.4-.6-20.9-.3-31.3',
    'M15.2 9.6c6.4-3.5 11.6 3.3 17.9.3-1.4 3.9-1.4 7.5-.1 11.3-6.4 3.1-11.6-3.7-17.9-.7',
    'M10.5 41.2c3.6-.7 7.1-.7 10.6-.2',
  ],
  'clone-me': [
    'M10.8 15.4c-.2-2.9 1.8-4.9 4.7-5l11.9-.2c2.9 0 4.9 1.9 5 4.8l.1 12c0 2.9-1.9 4.9-4.8 5l-12 .1c-2.9 0-4.8-1.9-4.8-4.8z',
    'M36.8 20.4c.6 1.1.9 2.3.9 3.7l-.1 9.7c0 3-2 5-5 5.1l-9.8.1c-1.5 0-2.8-.4-3.8-1.1',
  ],
  'chase-leads': [
    'M14.6 11.6l.3 10.3c.2 5.6 4 9.4 9.2 9.3 5.2 0 8.9-4 8.8-9.6l-.2-10.1',
    'M12.9 16.9l6.2-.3M35.2 16.6l-6.2-.2',
    'M19.8 38.6l1.6-3.1M28.3 38.6l-1.6-3.1M24.1 40.2l-.1-3.4',
  ],
  'get-invoices-paid': [
    'M28.2 14.3c5.6-.4 9.8 4 9.6 9.7-.2 5.7-4.6 9.8-10 9.6-5.3-.2-9.3-4.6-9.1-9.9.2-5.2 4-9 9.5-9.4z',
    'M28.1 18.7c3.2-.2 5.6 2.3 5.4 5.5-.1 3.2-2.6 5.5-5.7 5.4-3-.1-5.1-2.6-5-5.6.1-3 2.3-5.2 5.3-5.3z',
    'M7.9 19.4c2.5-.7 4.9-1 7.4-1M6.6 26.4c2.6-.2 5.2-.2 7.8 0M8 33.1c2.4.5 4.8.8 7.2.9',
  ],
  'chase-late-payers': [
    'M24 15.3c6.2-.4 10.9 4.4 10.8 10.6-.2 6.3-5 10.9-11.1 10.7-6-.2-10.4-4.9-10.3-10.9.2-5.9 4.6-10.1 10.6-10.4z',
    'M23.9 20.6l.1 6 5.4 3.2',
    'M12.4 13.4c1-2.4 3-4 5.6-4.4M35.6 13.2c-1-2.3-3-3.9-5.6-4.3',
  ],
  'grow-following': [
    'M7.5 38.2c6.3-1.2 10.6-3.9 12.4-7.6 1.6-3.3-1-6-3.4-4.4-2.5 1.6-1.2 5.5 2.2 6.2 5.6 1.1 13-3.7 18.9-13.6',
    'M31.9 17.6c2.4-.6 4.5-.6 6.4 0-.9 1.9-1.4 3.9-1.6 6',
  ],
  'run-socials': [
    'M8.6 22.4c6.3-3 12.6-5.9 19-8.6.7 6.3.8 12.5.1 18.7-6.5-2.6-12.9-5.1-19.3-7.5-.3-.9-.2-1.7.2-2.6z',
    'M13.6 26.6c.4 2.9.9 5.8 1.7 8.7 1.4-.2 2.8-.5 4.1-.9',
    'M32.8 16.4l4.6-2.9M34.3 23.9l5.6-.1M32.9 31.4l4.6 3',
  ],
  'write-posts': [
    'M18.3 29.7c5.2-5.4 10.4-10.7 15.8-15.9 1.5-1.5 3.9-1.5 5.3.1 1.4 1.5 1.4 3.8-.1 5.3-5.3 5.2-10.6 10.3-15.9 15.4-2.4.8-4.7 1.4-7 1.9.5-2.3 1.1-4.6 1.9-6.8z',
    'M8.4 41c3-1.8 5.6-1.9 8.4-.3 2.9 1.6 5.5 1.5 8.4-.2',
  ],
  'win-back-customers': [
    'M24 29.6c-6.6-4.3-9.8-8.3-9.6-12.2.1-3 2.4-5 5.1-4.9 2 .1 3.5 1.3 4.5 3.4 1.1-2.1 2.7-3.3 4.7-3.4 2.8-.1 5 2 5 5 .1 4-3.1 7.9-9.7 12.1z',
    'M37.6 32.4c-3.5 4.6-8.1 6.8-13.5 6.6-4.4-.2-8.1-2-10.9-5.2',
    'M13.3 33.7c1.7.1 3.3.4 4.9.9M13.3 33.7c.3-1.6.8-3.1 1.6-4.6',
  ],
  'answer-customers': [
    'M9.7 12.4c9.6-.8 19.2-.8 28.8-.1 1.9.1 3 1.3 3.1 3.2.1 4.4 0 8.7-.2 13.1-.1 1.9-1.3 3-3.2 3.1-5.3.2-10.7.3-16 .3-2.7 2.3-5.5 4.5-8.3 6.6.1-2.2.3-4.4.5-6.6-1.4 0-2.8-.1-4.2-.2-1.9-.1-3-1.2-3.1-3.1-.1-4.4 0-8.7.2-13.1.1-1.9 1.3-3.1 3.3-3.2z',
    'M18.4 21.9l4.1 4.3 7.6-8.7',
  ],
  'onboard-signups': [
    'M17.4 40.6c-.3-9.8-.4-19.6-.1-29.4 0-1.4.8-2.2 2.2-2.3 4.3-.1 8.6-.1 12.9 0 1.4 0 2.2.9 2.2 2.3.3 9.8.2 19.6-.1 29.4',
    'M30.4 25.3c.4-.1.7.2.6.6-.1.4-.6.4-.8.1-.1-.3 0-.6.2-.7z',
    'M4.6 25.6c5.5-.4 11-.5 16.5-.3M21.2 25.3c-1.5-1.2-3.1-2.2-4.8-3M21.2 25.3c-1.6 1.1-3.2 2-5 2.8',
  ],
  'prep-meetings': [
    'M12.6 20.4c7.6-.6 15.2-.6 22.8-.1-.2 5.4-1.3 10.4-3.4 15-5.3.6-10.7.6-16 0-2.1-4.6-3.2-9.6-3.4-14.9z',
    'M35.2 23.6c2.6-.3 4.2 1 4.1 3.3-.1 2.3-1.9 3.8-4.7 3.8',
    'M20.6 15.4c-1-1.7-.9-3.3.3-4.8 1.1-1.5 1.2-3 .3-4.6M28.4 15.4c-1-1.7-.9-3.3.3-4.8 1.1-1.5 1.2-3 .3-4.6',
  ],
  'run-my-day': [
    'M24 16.4c4.3-.3 7.6 3 7.4 7.4-.2 4.4-3.6 7.6-7.8 7.4-4.2-.2-7.2-3.6-7-7.7.2-4 3.2-6.9 7.4-7.1z',
    'M24 5.5c.1 1.7.1 3.4 0 5.1M24 37.4c.1 1.7.1 3.4 0 5.1M5.5 24c1.7-.1 3.4-.1 5.1 0M37.4 24c1.7-.1 3.4-.1 5.1 0M11.2 11.2c1.2 1.2 2.4 2.4 3.5 3.7M33.3 33.3c1.2 1.2 2.4 2.4 3.5 3.7M36.8 11.2c-1.2 1.2-2.4 2.4-3.5 3.7M14.7 33.3c-1.2 1.2-2.4 2.4-3.5 3.7',
  ],
  'do-my-hiring': [
    'M21 10.4c5.8-.4 10.3 4 10.1 9.8-.2 5.8-4.8 10.1-10.5 9.9-5.6-.2-9.7-4.6-9.5-10.2.2-5.4 4.3-9.1 9.9-9.5z',
    'M28.8 28.3c3.2 3.1 6.2 6.2 9.1 9.5',
    'M21 14.9c.6 1.9 1.8 3.1 3.7 3.7-1.9.6-3.1 1.8-3.7 3.7-.6-1.9-1.8-3.1-3.7-3.7 1.9-.6 3.1-1.8 3.7-3.7z',
  ],
  'do-research': [
    'M24 12.9c-4.6-2.6-9.6-3.6-15.1-3-.4 8.7-.4 17.4 0 26.1 5.4-.5 10.4.4 15.1 2.9 4.7-2.5 9.7-3.4 15.1-2.9.4-8.7.4-17.4 0-26.1-5.5-.6-10.5.4-15.1 3z',
    'M24 13.1c-.3 8.5-.3 16.9 0 25.4',
  ],
  'write-emails': [
    'M8.6 13.4c10.3-.8 20.5-.8 30.8-.1.3 7.1.3 14.2-.1 21.3-10.2.7-20.4.7-30.6 0-.4-7.1-.4-14.2-.1-21.2z',
    'M9.2 14.2c4.9 4.4 9.8 8.7 14.8 12.9 5-4.3 9.9-8.7 14.7-13.1',
  ],
  'plan-week': [
    'M9.3 12.6c9.8-.7 19.6-.7 29.4-.1.4 8.9.4 17.8-.1 26.7-9.7.6-19.4.6-29.1 0-.5-8.8-.5-17.7-.2-26.6z',
    'M17.9 8.9c.2 2.4.2 4.8.1 7.2M30.2 8.7c.2 2.4.2 4.8.1 7.2M9.5 21.4c9.7-.5 19.4-.5 29.1-.1',
    'M27.5 27.3c2.6-.4 4.6 1 4.7 3.3.1 2.4-1.8 4.2-4.4 4.2-2.6 0-4.5-1.7-4.5-4s1.7-3.3 4.2-3.5z',
  ],
  'write-reports': [
    'M13.4 6.9c7.2-.5 14.4-.5 21.6 0 .4 11.4.4 22.8-.1 34.2-7.1.5-14.2.5-21.3 0-.5-11.4-.5-22.8-.2-34.2z',
    'M18.9 12.4c3.5-.3 7-.3 10.4-.1',
    'M19.2 33.6c0-2.3 0-4.5.1-6.8M24.1 33.7c-.1-3.9-.1-7.8 0-11.7M29 33.6c0-6 .1-11.9.2-17.9',
  ],
  'make-slides': [
    'M9.9 10.7c9.5-.6 19-.6 28.5-.1.4 6.6.4 13.2-.1 19.8-9.4.6-18.8.6-28.2 0-.5-6.6-.5-13.2-.2-19.7z',
    'M14.8 25.2c2.9-2.7 5.7-5.5 8.4-8.4 1.5 1.5 3 2.9 4.6 4.3 1.9-2.1 3.8-4.3 5.6-6.5',
    'M24 30.9c.1 2.2.1 4.3 0 6.5M16.8 41.3c2.3-3.6 4.7-7.1 7.2-10.6M31.2 41.3c-2.3-3.6-4.7-7.1-7.2-10.6',
  ],
  'tame-inbox': [
    'M8.9 25.1c3.8-.4 7.6-.5 11.4-.4.9 2.5 2.2 3.7 3.7 3.7 1.5 0 2.7-1.2 3.6-3.7 3.8-.1 7.6 0 11.5.4.5 4.3.4 8.6-.3 12.9-9.9.7-19.7.7-29.6 0-.7-4.3-.8-8.6-.3-12.9z',
    'M24 6.5c.2 3.9.2 7.8.1 11.7M24.1 18.2c-1.5-1.2-2.9-2.5-4.2-3.9M24.1 18.2c1.4-1.3 2.8-2.6 4.1-4',
  ],
  'squash-bugs': [
    'M24 18.6c4.3-.2 7.3 3.2 7.2 8.1-.1 5.2-3.1 9-7.3 8.9-4.2-.1-7.1-3.9-7.1-9.1 0-4.9 2.9-7.7 7.2-7.9z',
    'M17.4 23.6c4.4-.7 8.9-.7 13.3-.1',
    'M20.8 18.9c-1.2-1.8-2.7-3.2-4.5-4.2M27.3 18.8c1.2-1.8 2.7-3.2 4.5-4.2',
    'M16.9 26.4c-2.1-.1-4.1.3-6.1 1M16.9 30.9c-1.9.6-3.7 1.4-5.3 2.5M31.1 26.4c2.1-.1 4.1.3 6.1 1M31.1 30.9c1.9.6 3.7 1.4 5.3 2.5',
  ],
};

type UseCaseTheme = {
  ink: string;
  ring: string;
};

type InkName = 'purple' | 'blue' | 'teal' | 'orange' | 'sunflower' | 'pink';

const INKS: Record<InkName, UseCaseTheme> = {
  purple: {
    ink: 'text-swatch-1-ink',
    ring: 'hover:ring-swatch-1-mark/40',
  },
  blue: {
    ink: 'text-swatch-11-ink',
    ring: 'hover:ring-swatch-11-mark/40',
  },
  teal: {
    ink: 'text-swatch-9-ink',
    ring: 'hover:ring-swatch-9-mark/40',
  },
  orange: {
    ink: 'text-swatch-5-ink',
    ring: 'hover:ring-swatch-5-mark/40',
  },
  sunflower: {
    ink: 'text-swatch-6-ink',
    ring: 'hover:ring-swatch-6-mark/40',
  },
  pink: {
    ink: 'text-swatch-3-ink',
    ring: 'hover:ring-swatch-3-mark/40',
  },
};

const CARD_INKS: Record<string, InkName> = {
  'do-research': 'purple',
  'write-emails': 'blue',
  'plan-week': 'teal',
  'write-reports': 'sunflower',
  'make-slides': 'pink',
  'tame-inbox': 'orange',
  'answer-customers': 'teal',
  'chase-late-payers': 'orange',
  'chase-leads': 'blue',
  'clone-me': 'purple',
  'close-deals': 'teal',
  'do-my-hiring': 'sunflower',
  'fill-pipeline': 'purple',
  'get-invoices-paid': 'sunflower',
  'grow-following': 'pink',
  'onboard-signups': 'teal',
  'prep-meetings': 'blue',
  'run-my-day': 'sunflower',
  'run-socials': 'orange',
  'squash-bugs': 'orange',
  'take-from-rivals': 'purple',
  'win-back-customers': 'pink',
  'write-posts': 'blue',
};

const CARD_SURFACE = 'bg-gray-3 ring-gray-6';

export const useCaseCardArt = { resolveTheme, CARD_SURFACE };