enzostvs HF staff commited on
Commit
a7f8fd9
1 Parent(s): 83433b0

take care of btn

Browse files
Files changed (1) hide show
  1. components/form.tsx +10 -2
components/form.tsx CHANGED
@@ -163,13 +163,21 @@ export const Form = ({ children }: { children: React.ReactNode }) => {
163
  </p>
164
  </div>
165
  <button
166
- className="rounded-xl bg-stone-900/90 border-white/5 border px-6 py-3 font-semibold text-base text-white mt-6 hover:brightness-125 transition-all duration-200"
 
 
 
 
 
 
 
167
  onClick={() => {
 
168
  generate();
169
  generateMusic();
170
  }}
171
  >
172
- Generate track
173
  </button>
174
  {(loading || results?.title || results?.cover) && (
175
  <div className="mt-6 space-y-6 flex flex-col">
 
163
  </p>
164
  </div>
165
  <button
166
+ className={classNames(
167
+ "rounded-xl bg-stone-900/90 border-white/5 border px-6 py-3 font-semibold text-base text-white mt-6 hover:brightness-125 transition-all duration-200",
168
+ {
169
+ "animate-pulse": loading,
170
+ "opacity-50 !cursor-not-allowed": !modelLoaded,
171
+ }
172
+ )}
173
+ disabled={loading || !modelLoaded}
174
  onClick={() => {
175
+ if (loading || !modelLoaded) return;
176
  generate();
177
  generateMusic();
178
  }}
179
  >
180
+ {!modelLoaded ? "Waiting for model loaded" : "Generate music"}
181
  </button>
182
  {(loading || results?.title || results?.cover) && (
183
  <div className="mt-6 space-y-6 flex flex-col">