reduce # generations to 10
This commit is contained in:
parent
80547e9ae1
commit
fa6a92b9b4
@ -181,7 +181,7 @@ export default {
|
||||
if (!dbUser) {
|
||||
return new Response("User not found.", { status: 400 });
|
||||
}
|
||||
if (dbUser.generations !== null && dbUser.generations >= 30) {
|
||||
if (dbUser.generations !== null && dbUser.generations >= 10) {
|
||||
return new Response("You reached the maximum # of generations.", { status: 400 });
|
||||
}
|
||||
|
||||
|
@ -529,10 +529,6 @@ export default function CodeEditor({
|
||||
setFiles(response);
|
||||
setDeletingFolderId("");
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
setDeletingFolderId("");
|
||||
}, 3000);
|
||||
};
|
||||
|
||||
if (isAwaitingConnection)
|
||||
|
@ -59,7 +59,7 @@ export default function GenerateInput({
|
||||
}: {
|
||||
regenerate?: boolean;
|
||||
}) => {
|
||||
if (user.generations >= 30) {
|
||||
if (user.generations >= 10) {
|
||||
toast.error(
|
||||
"You reached the maximum # of generations. Contact @ishaandey_ on X/Twitter to reset :)"
|
||||
);
|
||||
|
@ -1,4 +1,4 @@
|
||||
"use client"
|
||||
"use client";
|
||||
|
||||
import {
|
||||
DropdownMenu,
|
||||
@ -7,23 +7,24 @@ import {
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu"
|
||||
import { User } from "@/lib/types"
|
||||
import { useClerk } from "@clerk/nextjs"
|
||||
import { LogOut, Pencil, Sparkles } from "lucide-react"
|
||||
import { useRouter } from "next/navigation"
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { User } from "@/lib/types";
|
||||
import { useClerk } from "@clerk/nextjs";
|
||||
import { LogOut, Pencil, Sparkles } from "lucide-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export default function UserButton({ userData }: { userData: User }) {
|
||||
if (!userData) return null
|
||||
if (!userData) return null;
|
||||
|
||||
const { signOut } = useClerk()
|
||||
const router = useRouter()
|
||||
const { signOut } = useClerk();
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger>
|
||||
<div className="w-9 h-9 font-mono rounded-full overflow-hidden bg-gradient-to-t from-neutral-800 to-neutral-600 flex items-center justify-center text-sm font-medium">
|
||||
{userData.name && userData.name
|
||||
{userData.name &&
|
||||
userData.name
|
||||
.split(" ")
|
||||
.slice(0, 2)
|
||||
.map((name) => name[0].toUpperCase())}
|
||||
@ -41,13 +42,13 @@ export default function UserButton({ userData }: { userData: User }) {
|
||||
<div className="py-1.5 px-2 w-full flex flex-col items-start text-sm">
|
||||
<div className="flex items-center">
|
||||
<Sparkles className={`h-4 w-4 mr-2 text-indigo-500`} />
|
||||
AI Usage: {userData.generations}/30
|
||||
AI Usage: {userData.generations}/10
|
||||
</div>
|
||||
<div className="rounded-full w-full mt-2 h-2 overflow-hidden bg-secondary">
|
||||
<div
|
||||
className="h-full bg-indigo-500 rounded-full"
|
||||
style={{
|
||||
width: `${(userData.generations * 100) / 30}%`,
|
||||
width: `${(userData.generations * 100) / 10}%`,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
@ -66,5 +67,5 @@ export default function UserButton({ userData }: { userData: User }) {
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user