|
1 | | -"use client"; |
2 | | - |
3 | | -import { |
4 | | - Alert, |
5 | | - AlertDescription, |
6 | | - AlertIcon, |
7 | | - AlertTitle, |
8 | | - Flex, |
9 | | - IconButton, |
10 | | -} from "@chakra-ui/react"; |
11 | | -import { useLocalStorage } from "hooks/useLocalStorage"; |
12 | | -import { XIcon } from "lucide-react"; |
13 | | -import { Text, TrackedLink } from "tw-components"; |
14 | | - |
15 | | -export const SmartWalletsBillingAlert = ({ |
16 | | - dismissible = false, |
17 | | -}: { |
18 | | - dismissible?: boolean; |
19 | | -}) => { |
20 | | - const [dismissed, setDismissed] = useLocalStorage( |
21 | | - "dismissed-smart-wallets-billing-alert", |
22 | | - false, |
23 | | - true, |
24 | | - ); |
25 | | - |
26 | | - if (dismissible && dismissed) { |
27 | | - return true; |
28 | | - } |
| 1 | +import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; |
| 2 | +import { TrackedUnderlineLink } from "@/components/ui/tracked-link"; |
| 3 | +import { CircleAlertIcon } from "lucide-react"; |
29 | 4 |
|
| 5 | +export const SmartWalletsBillingAlert = () => { |
30 | 6 | return ( |
31 | | - <Alert |
32 | | - status="warning" |
33 | | - borderRadius="md" |
34 | | - as={Flex} |
35 | | - alignItems="start" |
36 | | - justifyContent="space-between" |
37 | | - mb={4} |
38 | | - variant="left-accent" |
39 | | - bg="backgroundCardHighlight" |
40 | | - > |
41 | | - <div className="flex flex-row"> |
42 | | - <AlertIcon boxSize={4} mt={1} ml={1} /> |
43 | | - <Flex flexDir="column" gap={1} pl={1}> |
44 | | - <AlertTitle>Account Abstraction on Mainnet</AlertTitle> |
45 | | - <AlertDescription> |
46 | | - <Text as="span" pr={1}> |
47 | | - You've enabled Account Abstraction for one of your API keys. |
48 | | - <br /> |
49 | | - To enable AA on mainnet chains, |
50 | | - </Text>{" "} |
51 | | - <TrackedLink |
52 | | - href="/team/~/~/settings/billing" |
53 | | - category="api_keys" |
54 | | - label="smart_wallets_missing_billing" |
55 | | - fontWeight="medium" |
56 | | - color="blue.500" |
57 | | - > |
58 | | - <Text as="span" color="blue.500"> |
59 | | - subscribe to a billing plan. |
60 | | - </Text> |
61 | | - </TrackedLink> |
62 | | - </AlertDescription> |
63 | | - </Flex> |
64 | | - </div> |
65 | | - |
66 | | - {dismissible && ( |
67 | | - <IconButton |
68 | | - size="xs" |
69 | | - aria-label="Close notice" |
70 | | - icon={<XIcon className="size-4" />} |
71 | | - colorScheme="blackAlpha" |
72 | | - color="white" |
73 | | - variant="ghost" |
74 | | - opacity={0.6} |
75 | | - _hover={{ opacity: 1 }} |
76 | | - onClick={() => setDismissed(true)} |
77 | | - /> |
78 | | - )} |
| 7 | + <Alert variant="warning"> |
| 8 | + <CircleAlertIcon className="size-5" /> |
| 9 | + <AlertTitle>Account Abstraction on Mainnet</AlertTitle> |
| 10 | + <AlertDescription> |
| 11 | + To enable AA on mainnet chains,{" "} |
| 12 | + <TrackedUnderlineLink |
| 13 | + href="/team/~/~/settings/billing" |
| 14 | + category="api_keys" |
| 15 | + label="smart_wallets_missing_billing" |
| 16 | + > |
| 17 | + subscribe to a billing plan. |
| 18 | + </TrackedUnderlineLink> |
| 19 | + </AlertDescription> |
79 | 20 | </Alert> |
80 | 21 | ); |
81 | 22 | }; |
0 commit comments