|
| 1 | +import { Button } from "@/components/ui/button"; |
| 2 | +import { DotNetIcon } from "components/icons/brand-icons/DotNetIcon"; |
| 3 | +import { ReactIcon } from "components/icons/brand-icons/ReactIcon"; |
| 4 | +import { TypeScriptIcon } from "components/icons/brand-icons/TypeScriptIcon"; |
| 5 | +import { UnityIcon } from "components/icons/brand-icons/UnityIcon"; |
| 6 | +import { UnrealIcon } from "components/icons/brand-icons/UnrealIcon"; |
| 7 | +import { DocLink } from "components/shared/DocLink"; |
| 8 | +import { ArrowRightIcon } from "lucide-react"; |
| 9 | +import authIcon from "../../../../../../public/assets/tw-icons/auth.svg"; |
| 10 | +import accountAbstractionIcon from "../../../../../../public/assets/tw-icons/account-abstraction.svg"; |
| 11 | +import payIcon from "../../../../../../public/assets/tw-icons/pay.svg"; |
| 12 | +import walletsIcon from "../../../../../../public/assets/tw-icons/wallets.svg"; |
| 13 | +import socialAuthIcon from "../../../../../../public/assets/tw-icons/social-auth.svg"; |
| 14 | +import Image, { StaticImageData } from "next/image"; |
| 15 | +import { cn } from "@/lib/utils"; |
| 16 | + |
| 17 | +export function EmptyState() { |
| 18 | + return ( |
| 19 | + <div className="md:h-[770px] py-24 p-6 container flex items-center justify-center"> |
| 20 | + <div className="flex-col gap-8 flex items-center group justify-center"> |
| 21 | + <div className="flex flex-col gap-6 max-w-[500px] justify-center items-center"> |
| 22 | + <AnimatedIcons /> |
| 23 | + <div className="text-center flex flex-col gap-0.5"> |
| 24 | + <h3 className="text-2xl font-semibold text-foreground"> |
| 25 | + Get started with the Connect SDK |
| 26 | + </h3> |
| 27 | + <p className="text-muted-foreground text-base"> |
| 28 | + Add the Connect SDK to your app to start collecting analytics. |
| 29 | + </p> |
| 30 | + </div> |
| 31 | + <div className="flex flex-wrap gap-2 justify-center items-center"> |
| 32 | + <SDKBadge |
| 33 | + icon={TypeScriptIcon} |
| 34 | + label="TypeScript" |
| 35 | + href="https://portal.thirdweb.com/typescript/v5/inAppWallet" |
| 36 | + /> |
| 37 | + <SDKBadge |
| 38 | + icon={ReactIcon} |
| 39 | + label="React" |
| 40 | + href="https://portal.thirdweb.com/react/v5/in-app-wallet/get-started" |
| 41 | + /> |
| 42 | + <SDKBadge |
| 43 | + icon={ReactIcon} |
| 44 | + label="React Native" |
| 45 | + href="https://portal.thirdweb.com/react/v5/in-app-wallet/get-started" |
| 46 | + /> |
| 47 | + <SDKBadge |
| 48 | + icon={UnityIcon} |
| 49 | + label="Unity" |
| 50 | + href="https://portal.thirdweb.com/unity/v5/wallets/in-app-wallet" |
| 51 | + /> |
| 52 | + <SDKBadge |
| 53 | + icon={UnrealIcon} |
| 54 | + label="Unreal" |
| 55 | + href="https://portal.thirdweb.com/unreal-engine/getting-started" |
| 56 | + /> |
| 57 | + <SDKBadge |
| 58 | + icon={DotNetIcon} |
| 59 | + label=".NET" |
| 60 | + href="https://portal.thirdweb.com/flutter/v5/in-app-wallet/get-started" |
| 61 | + /> |
| 62 | + </div> |
| 63 | + </div> |
| 64 | + <div className="flex gap-2"> |
| 65 | + <Button variant="outline">View Docs</Button> |
| 66 | + <Button variant="primary"> |
| 67 | + Get Started |
| 68 | + <ArrowRightIcon className="size-4 ml-2" /> |
| 69 | + </Button> |
| 70 | + </div> |
| 71 | + </div> |
| 72 | + </div> |
| 73 | + ); |
| 74 | +} |
| 75 | + |
| 76 | +function AnimatedIcons() { |
| 77 | + return ( |
| 78 | + <div className="flex -space-x-2"> |
| 79 | + <Icon |
| 80 | + icon={walletsIcon} |
| 81 | + className="z-[0] -rotate-[16deg] group-hover:-rotate-[32deg] scale-1 group-hover:scale-[1.2] translate-x-[0px] group-hover:-translate-x-[44px] translate-y-[0px] group-hover:-translate-y-[12px]" |
| 82 | + /> |
| 83 | + <Icon |
| 84 | + icon={payIcon} |
| 85 | + className="z-[1] -rotate-[12deg] group-hover:-rotate-[24deg] scale-1 group-hover:scale-[1.2] translate-x-[0px] group-hover:-translate-x-[28px] -translate-y-[12px] group-hover:-translate-y-[40px]" |
| 86 | + /> |
| 87 | + <Icon |
| 88 | + icon={authIcon} |
| 89 | + className="z-[2] scale-1 group-hover:scale-[1.2] -translate-y-[16px] group-hover:-translate-y-[52px]" |
| 90 | + /> |
| 91 | + <Icon |
| 92 | + icon={accountAbstractionIcon} |
| 93 | + className="z-[1] rotate-[12deg] group-hover:rotate-[24deg] scale-1 group-hover:scale-[1.2] translate-x-[0px] group-hover:translate-x-[28px] -translate-y-[12px] group-hover:-translate-y-[40px]" |
| 94 | + /> |
| 95 | + <Icon |
| 96 | + icon={socialAuthIcon} |
| 97 | + className="z-[0] rotate-[16deg] group-hover:rotate-[32deg] scale-1 group-hover:scale-[1.2] translate-x-[0px] group-hover:translate-x-[44px] translate-y-[0px] group-hover:-translate-y-[12px]" |
| 98 | + /> |
| 99 | + </div> |
| 100 | + ); |
| 101 | +} |
| 102 | + |
| 103 | +function Icon({ |
| 104 | + icon, |
| 105 | + className, |
| 106 | +}: { |
| 107 | + icon: StaticImageData; |
| 108 | + className?: string; |
| 109 | +}) { |
| 110 | + return ( |
| 111 | + <div |
| 112 | + className={cn( |
| 113 | + "border rounded-xl size-10 flex items-center justify-center bg-background transition-all duration-200 ease-in-out", |
| 114 | + className, |
| 115 | + )} |
| 116 | + > |
| 117 | + <Image |
| 118 | + src={icon} |
| 119 | + alt="" |
| 120 | + width={24} |
| 121 | + height={24} |
| 122 | + className="rounded-full" |
| 123 | + /> |
| 124 | + </div> |
| 125 | + ); |
| 126 | +} |
| 127 | + |
| 128 | +function SDKBadge({ |
| 129 | + icon, |
| 130 | + label, |
| 131 | + href, |
| 132 | +}: { icon: React.FC<{ className?: string }>; label: string; href: string }) { |
| 133 | + return ( |
| 134 | + <div className="py-1 px-2.5 rounded-full bg-neutral-200 dark:bg-neutral-800"> |
| 135 | + <DocLink link={href} label={label} icon={icon} /> |
| 136 | + </div> |
| 137 | + ); |
| 138 | +} |
0 commit comments