From 1085c33dc46979b02dbf7b04f88f499e472fd9ec Mon Sep 17 00:00:00 2001 From: Kamran Ahmed <kamranahmed.se@gmail.com> Date: Fri, 14 Mar 2025 21:10:57 +0000 Subject: [PATCH] Regenerate functionality --- .../GenerateCourse/RegenerateLesson.tsx | 16 ++-------------- .../GenerateCourse/RegenerateOutline.tsx | 16 ++-------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/src/components/GenerateCourse/RegenerateLesson.tsx b/src/components/GenerateCourse/RegenerateLesson.tsx index 7bb3334ea..1323aa551 100644 --- a/src/components/GenerateCourse/RegenerateLesson.tsx +++ b/src/components/GenerateCourse/RegenerateLesson.tsx @@ -2,7 +2,6 @@ import { PenSquare, RefreshCcw } from 'lucide-react'; import { useRef, useState } from 'react'; import { useOutsideClick } from '../../hooks/use-outside-click'; import { cn } from '../../lib/classname'; -import { useIsPaidUser } from '../../queries/billing'; import { UpgradeAccountModal } from '../Billing/UpgradeAccountModal'; import { ModifyCoursePrompt } from './ModifyCoursePrompt'; @@ -19,8 +18,6 @@ export function RegenerateLesson(props: RegenerateLessonProps) { const ref = useRef<HTMLDivElement>(null); - const { isPaidUser } = useIsPaidUser(); - useOutsideClick(ref, () => setIsDropdownVisible(false)); return ( @@ -58,12 +55,7 @@ export function RegenerateLesson(props: RegenerateLessonProps) { <div className="absolute right-0 top-full min-w-[170px] overflow-hidden rounded-md border border-gray-200 bg-white"> <button onClick={() => { - if (!isPaidUser) { - setIsDropdownVisible(false); - setShowUpgradeModal(true); - } else { - onRegenerateLesson(); - } + onRegenerateLesson(); }} className="flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-100" > @@ -77,11 +69,7 @@ export function RegenerateLesson(props: RegenerateLessonProps) { <button onClick={() => { setIsDropdownVisible(false); - if (!isPaidUser) { - setShowUpgradeModal(true); - } else { - setShowPromptModal(true); - } + setShowPromptModal(true); }} className="flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-100" > diff --git a/src/components/GenerateCourse/RegenerateOutline.tsx b/src/components/GenerateCourse/RegenerateOutline.tsx index 9aa4cb894..aa2a3ef20 100644 --- a/src/components/GenerateCourse/RegenerateOutline.tsx +++ b/src/components/GenerateCourse/RegenerateOutline.tsx @@ -2,7 +2,6 @@ import { PenSquare, RefreshCcw } from 'lucide-react'; import { useRef, useState } from 'react'; import { useOutsideClick } from '../../hooks/use-outside-click'; import { cn } from '../../lib/classname'; -import { useIsPaidUser } from '../../queries/billing'; import { UpgradeAccountModal } from '../Billing/UpgradeAccountModal'; import { ModifyCoursePrompt } from './ModifyCoursePrompt'; @@ -19,8 +18,6 @@ export function RegenerateOutline(props: RegenerateOutlineProps) { const ref = useRef<HTMLDivElement>(null); - const { isPaidUser } = useIsPaidUser(); - useOutsideClick(ref, () => setIsDropdownVisible(false)); return ( @@ -56,12 +53,7 @@ export function RegenerateOutline(props: RegenerateOutlineProps) { <div className="absolute right-0 top-full min-w-[170px] overflow-hidden rounded-md border border-gray-200 bg-white"> <button onClick={() => { - if (!isPaidUser) { - setIsDropdownVisible(false); - setShowUpgradeModal(true); - } else { - onRegenerateOutline(); - } + onRegenerateOutline(); }} className="flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-100" > @@ -75,11 +67,7 @@ export function RegenerateOutline(props: RegenerateOutlineProps) { <button onClick={() => { setIsDropdownVisible(false); - if (!isPaidUser) { - setShowUpgradeModal(true); - } else { - setShowPromptModal(true); - } + setShowPromptModal(true); }} className="flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-100" >