|
| 1 | +import type { ComponentType, ReactElement } from 'react'; |
| 2 | +import React, { useId } from 'react'; |
| 3 | +import { |
| 4 | + Typography, |
| 5 | + TypographyColor, |
| 6 | + TypographyTag, |
| 7 | + TypographyType, |
| 8 | +} from '../typography/Typography'; |
| 9 | +import { Button, ButtonSize, ButtonVariant } from '../buttons/Button'; |
| 10 | +import { anchorDefaultRel } from '../../lib/strings'; |
| 11 | +import { plusPublicApiDocs } from '../../lib/constants'; |
| 12 | +import type { IconProps } from '../Icon'; |
| 13 | +import { IconSize } from '../Icon'; |
| 14 | +import { AiIcon, MagicIcon, TerminalIcon } from '../icons'; |
| 15 | + |
| 16 | +type ShowcaseCard = { |
| 17 | + title: string; |
| 18 | + body: string; |
| 19 | + icon: ComponentType<IconProps>; |
| 20 | + iconClasses: string; |
| 21 | +}; |
| 22 | + |
| 23 | +const showcaseCards: Array<ShowcaseCard> = [ |
| 24 | + { |
| 25 | + title: 'Keep your coding agent current', |
| 26 | + body: `LLMs stop learning the day they ship. Wire daily.dev in so your agent can reference current libraries, recent CVEs, and what senior devs are actually reading. Pre-built integrations for Claude Code, Cursor, Codex, and OpenClaw.`, |
| 27 | + icon: AiIcon, |
| 28 | + iconClasses: 'bg-overlay-float-water text-accent-water-default', |
| 29 | + }, |
| 30 | + { |
| 31 | + title: `Ship the internal tool you've been putting off`, |
| 32 | + body: `The Slack bot for #engineering. The weekly team digest. The tech radar dashboard. Whatever's been sitting in your Notes doc is a few endpoints away.`, |
| 33 | + icon: TerminalIcon, |
| 34 | + iconClasses: 'bg-overlay-float-bun text-accent-bun-default', |
| 35 | + }, |
| 36 | + { |
| 37 | + title: 'Automate your own reading exactly how you want it', |
| 38 | + body: `Mirror your personalized feed to Notion, Obsidian, or email. Get alerts when the topics you follow start trending. Your workflow, no copy-paste.`, |
| 39 | + icon: MagicIcon, |
| 40 | + iconClasses: 'bg-overlay-float-cabbage text-accent-cabbage-default', |
| 41 | + }, |
| 42 | +]; |
| 43 | + |
| 44 | +const ShowcaseCardView = ({ card }: { card: ShowcaseCard }): ReactElement => { |
| 45 | + const { icon: Icon, iconClasses } = card; |
| 46 | + |
| 47 | + return ( |
| 48 | + <div className="flex flex-1 flex-col rounded-16 border border-border-subtlest-tertiary bg-surface-float p-6"> |
| 49 | + <div |
| 50 | + className={`mb-4 flex size-12 items-center justify-center rounded-12 ${iconClasses}`} |
| 51 | + > |
| 52 | + <Icon secondary size={IconSize.Medium} /> |
| 53 | + </div> |
| 54 | + <Typography |
| 55 | + bold |
| 56 | + className="mb-2" |
| 57 | + color={TypographyColor.Primary} |
| 58 | + tag={TypographyTag.H3} |
| 59 | + type={TypographyType.Title3} |
| 60 | + > |
| 61 | + {card.title} |
| 62 | + </Typography> |
| 63 | + <Typography |
| 64 | + color={TypographyColor.Tertiary} |
| 65 | + type={TypographyType.Callout} |
| 66 | + > |
| 67 | + {card.body} |
| 68 | + </Typography> |
| 69 | + </div> |
| 70 | + ); |
| 71 | +}; |
| 72 | + |
| 73 | +export const PlusApiShowcase = (): ReactElement => { |
| 74 | + const id = useId(); |
| 75 | + const titleId = `${id}-title`; |
| 76 | + |
| 77 | + return ( |
| 78 | + <section aria-labelledby={titleId} className="my-10"> |
| 79 | + <Typography |
| 80 | + bold |
| 81 | + className="mb-10 text-center" |
| 82 | + id={titleId} |
| 83 | + tag={TypographyTag.H2} |
| 84 | + type={TypographyType.Title3} |
| 85 | + > |
| 86 | + What you can build with the API |
| 87 | + </Typography> |
| 88 | + <div className="mx-auto flex max-w-5xl flex-col gap-4 laptop:flex-row"> |
| 89 | + {showcaseCards.map((card) => ( |
| 90 | + <ShowcaseCardView key={card.title} card={card} /> |
| 91 | + ))} |
| 92 | + </div> |
| 93 | + <div className="mt-8 flex justify-center"> |
| 94 | + <Button |
| 95 | + tag="a" |
| 96 | + href={plusPublicApiDocs} |
| 97 | + target="_blank" |
| 98 | + rel={anchorDefaultRel} |
| 99 | + size={ButtonSize.Medium} |
| 100 | + variant={ButtonVariant.Secondary} |
| 101 | + > |
| 102 | + Read the API docs |
| 103 | + </Button> |
| 104 | + </div> |
| 105 | + </section> |
| 106 | + ); |
| 107 | +}; |
0 commit comments