## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
The focus of this PR is to refactor and optimize components in the dashboard app.
### Detailed summary
- Updated rendering of supported platforms in `ConnectLanding`
- Refactored `SupportedPlatformLink` component
- Improved UI and functionality in `Analytics` and `UsageCard`
- Enhanced user experience in `index.tsx` for embedded wallets
> The following files were skipped due to too many changes: `apps/dashboard/src/components/embedded-wallets/Users/index.tsx`, `apps/dashboard/src/pages/dashboard/connect/in-app-wallets.tsx`
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { TrackedLinkTW } from "@/components/ui/tracked-link";
|
|
import { cn } from "@/lib/utils";
|
|
import { SiReact } from "@react-icons/all-files/si/SiReact";
|
|
import { SiTypescript } from "@react-icons/all-files/si/SiTypescript";
|
|
import { SiUnity } from "@react-icons/all-files/si/SiUnity";
|
|
import type { IconType } from "react-icons/lib";
|
|
|
|
export function SupportedPlatformLink(props: {
|
|
platform: "React" | "React Native" | "Unity" | "TypeScript";
|
|
href: string;
|
|
trackingCategory: string;
|
|
className?: string;
|
|
}) {
|
|
let icon: IconType = SiReact;
|
|
if (props.platform === "Unity") {
|
|
icon = SiUnity;
|
|
} else if (props.platform === "TypeScript") {
|
|
icon = SiTypescript;
|
|
}
|
|
|
|
return (
|
|
<TrackedLinkTW
|
|
category={props.trackingCategory}
|
|
label={`platform-${props.platform.replace(" ", "-").toLowerCase()}`}
|
|
href={props.href}
|
|
target="_blank"
|
|
className={cn(
|
|
"flex items-center gap-2 text-muted-foreground hover:text-foreground text-sm",
|
|
props.className,
|
|
)}
|
|
>
|
|
{icon({ className: "size-4" })}
|
|
{props.platform}
|
|
</TrackedLinkTW>
|
|
);
|
|
}
|