Update UI for roadmap limit

ai/roadmap
Kamran Ahmed 8 months ago
parent 359cc332ec
commit 90b8563413
  1. 12
      src/components/GenerateRoadmap/RoadmapSearch.tsx

@ -34,7 +34,13 @@ export function RoadmapSearch(props: RoadmapSearchProps) {
</p> </p>
</div> </div>
<form <form
onSubmit={handleSubmit} onSubmit={(e) => {
if (limit > 0 && canGenerateMore) {
handleSubmit(e);
} else {
e.preventDefault();
}
}}
className="my-6 flex w-full max-w-[600px] flex-row" className="my-6 flex w-full max-w-[600px] flex-row"
> >
<input <input
@ -47,7 +53,7 @@ export function RoadmapSearch(props: RoadmapSearchProps) {
/> />
<button <button
className={cn( className={cn(
'ml-2 flex min-w-[127px] flex-shrink-0 items-center gap-2 rounded-md bg-black px-4 py-2 text-white', 'ml-2 flex min-w-[131px] flex-shrink-0 items-center gap-2 rounded-md bg-black px-4 py-2 text-white',
{ {
'cursor-not-allowed opacity-50': 'cursor-not-allowed opacity-50':
!limit || !roadmapTopic || limitUsed >= limit, !limit || !roadmapTopic || limitUsed >= limit,
@ -75,7 +81,7 @@ export function RoadmapSearch(props: RoadmapSearchProps) {
You have generated{' '} You have generated{' '}
<span <span
className={cn( className={cn(
'inline-block w-[55px] rounded-md border text-center text-sm tabular-nums text-gray-800 px-0.5', 'inline-block w-[55px] rounded-md border px-0.5 text-center text-sm tabular-nums text-gray-800',
{ {
'animate-pulse border-zinc-300 bg-zinc-300 text-zinc-300': 'animate-pulse border-zinc-300 bg-zinc-300 text-zinc-300':
!limit, !limit,

Loading…
Cancel
Save