|
1 | 1 | 'use client' |
2 | 2 |
|
3 | 3 | import { useSession } from 'next-auth/react' |
4 | | -import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' |
| 4 | +import { |
| 5 | + Card, |
| 6 | + CardContent, |
| 7 | + CardDescription, |
| 8 | + CardHeader, |
| 9 | + CardTitle, |
| 10 | +} from '@/components/ui/card' |
5 | 11 | import { Skeleton } from '@/components/ui/skeleton' |
6 | 12 | import { useEffect, useState } from 'react' |
7 | 13 | import { Input } from '@/components/ui/input' |
@@ -72,60 +78,92 @@ export default function RedeemPage({ params }: { params: { code: string } }) { |
72 | 78 | } |
73 | 79 |
|
74 | 80 | return ( |
75 | | - <Card className="bg-violet-100 dark:bg-violet-900"> |
76 | | - <CardHeader> |
77 | | - <CardTitle className="flex"> |
78 | | - <GiftIcon className="mr-2" /> |
79 | | - {data?.status.reason ? data.status.reason : "You've got credits!"} |
80 | | - </CardTitle> |
81 | | - </CardHeader> |
82 | | - |
83 | | - <CardContent> |
84 | | - <b>Hey {session?.user?.name} 👋</b> |
85 | | - {data?.status.reason && data.status.details?.msg ? ( |
86 | | - <p className="text-red-600 mt-2">{data.status.details.msg}</p> |
87 | | - ) : ( |
88 | | - <p> |
89 | | - Your friend {data?.referrerName} just scored you some sweet sweet |
90 | | - credits. |
91 | | - </p> |
92 | | - )} |
93 | | - </CardContent> |
| 81 | + <div className="flex flex-col space-y-6"> |
| 82 | + <Card className="bg-violet-100 dark:bg-violet-900"> |
| 83 | + <CardHeader> |
| 84 | + <CardTitle className="flex"> |
| 85 | + <GiftIcon className="mr-2" /> |
| 86 | + {data?.status.reason ? data.status.reason : "You've got credits!"} |
| 87 | + </CardTitle> |
| 88 | + </CardHeader> |
94 | 89 |
|
95 | | - <div className="flex flex-col space-y-2"> |
96 | 90 | <CardContent> |
97 | | - <p className="my-4"> |
98 | | - {data?.status.reason |
99 | | - ? `Fear not, you can still get started with Manicode! Here's how:` |
100 | | - : 'To redeem them, follow these steps:'} |
101 | | - </p> |
102 | | - <ol className="list-decimal list-inside space-y-6"> |
103 | | - <li> |
104 | | - Install Codebuff globally: |
105 | | - <InputWithCopyButton text={'npm i -g codebuff'} /> |
106 | | - </li> |
107 | | - <li> |
108 | | - Run Codebuff in Terminal |
109 | | - <InputWithCopyButton text={'codebuff'} /> |
110 | | - </li> |
111 | | - {!data?.status.reason && ( |
| 91 | + <b>Hey {session?.user?.name} 👋</b> |
| 92 | + {data?.status.reason && data.status.details?.msg ? ( |
| 93 | + <p className="text-red-600 mt-2">{data.status.details.msg}</p> |
| 94 | + ) : ( |
| 95 | + <p> |
| 96 | + Your friend {data?.referrerName} just scored you some sweet sweet |
| 97 | + credits. |
| 98 | + </p> |
| 99 | + )} |
| 100 | + </CardContent> |
| 101 | + |
| 102 | + <div className="flex flex-col space-y-2"> |
| 103 | + <CardContent> |
| 104 | + <p className="my-4"> |
| 105 | + {data?.status.reason |
| 106 | + ? `Fear not, you can still get started with Manicode! Here's how:` |
| 107 | + : 'To redeem them, follow these steps:'} |
| 108 | + </p> |
| 109 | + <ol className="list-decimal list-inside space-y-6"> |
112 | 110 | <li> |
113 | | - Paste this referral code in the CLI. |
114 | | - <InputWithCopyButton text={params.code} /> |
| 111 | + Install Codebuff globally: |
| 112 | + <InputWithCopyButton text={'npm i -g codebuff'} /> |
115 | 113 | </li> |
116 | | - )} |
117 | | - </ol> |
118 | | - </CardContent> |
119 | | - </div> |
| 114 | + <li> |
| 115 | + Run Codebuff in Terminal |
| 116 | + <InputWithCopyButton text={'codebuff'} /> |
| 117 | + </li> |
| 118 | + {!data?.status.reason && ( |
| 119 | + <li> |
| 120 | + Paste this referral code in the CLI. |
| 121 | + <InputWithCopyButton text={params.code} /> |
| 122 | + </li> |
| 123 | + )} |
| 124 | + </ol> |
| 125 | + </CardContent> |
| 126 | + </div> |
120 | 127 |
|
121 | | - {data?.isSameUser && ( |
| 128 | + {data?.isSameUser && ( |
| 129 | + <CardContent> |
| 130 | + <p className="font-bold text-red-600 mt-4"> |
| 131 | + Just FYI, this is your own referral code. (Others won't see |
| 132 | + this message). |
| 133 | + </p> |
| 134 | + </CardContent> |
| 135 | + )} |
| 136 | + </Card> |
| 137 | + <Card className="bg-violet-100 dark:bg-blue-900"> |
| 138 | + <CardHeader> |
| 139 | + <CardTitle className="flex"> |
| 140 | + <h2 className="text-2xl font-bold">What is Codebuff?</h2> |
| 141 | + </CardTitle> |
| 142 | + </CardHeader> |
122 | 143 | <CardContent> |
123 | | - <p className="font-bold text-red-600 mt-4"> |
124 | | - Just FYI, this is your own referral code. (Others won't see |
125 | | - this message). |
126 | | - </p> |
| 144 | + <CardDescription> |
| 145 | + <div className="flex justify-between items-center"> |
| 146 | + <p> |
| 147 | + Codebuff is a code-editing tool that uses natural language to |
| 148 | + edit your codebase. It's a coding assistant that |
| 149 | + understands your code structure and dependencies. |
| 150 | + </p> |
| 151 | + </div> |
| 152 | + </CardDescription> |
| 153 | + <div className="max-w-3xl mx-auto mt-4"> |
| 154 | + <h3>Watch a demo</h3> |
| 155 | + <div className="aspect-w-16 aspect-h-full h-96"> |
| 156 | + <iframe |
| 157 | + src="https://www.youtube.com/embed/dQ0NOMsu0dA" |
| 158 | + title="Codebuff Demo" |
| 159 | + allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" |
| 160 | + allowFullScreen |
| 161 | + className="h-full w-full rounded-lg shadow-lg" |
| 162 | + ></iframe> |
| 163 | + </div> |
| 164 | + </div> |
127 | 165 | </CardContent> |
128 | | - )} |
129 | | - </Card> |
| 166 | + </Card> |
| 167 | + </div> |
130 | 168 | ) |
131 | 169 | } |
0 commit comments