add disabled states on creation

This commit is contained in:
Ishaan Dey 2024-05-09 21:05:21 -07:00
parent b0b8a63f2f
commit 1500e84724
2 changed files with 7 additions and 3 deletions

View File

@ -128,7 +128,7 @@ export default function NewProjectModal({
<div className="grid grid-cols-2 w-full gap-2 mt-2">
{data.map((item) => (
<button
disabled={item.disabled}
disabled={item.disabled || loading}
key={item.id}
onClick={() => setSelected(item.id)}
className={`${
@ -155,7 +155,11 @@ export default function NewProjectModal({
<FormItem className="mb-4">
<FormLabel>Name</FormLabel>
<FormControl>
<Input placeholder="My Project" {...field} />
<Input
disabled={loading}
placeholder="My Project"
{...field}
/>
</FormControl>
<FormMessage />
</FormItem>
@ -168,6 +172,7 @@ export default function NewProjectModal({
<FormItem className="mb-8">
<FormLabel>Visibility</FormLabel>
<Select
disabled={loading}
onValueChange={field.onChange}
defaultValue={field.value}
>

View File

@ -8,7 +8,6 @@ export async function createSandbox(body: {
userId: string
visibility: string
}) {
console.log("creating. body:", body)
const res = await fetch(
"https://database.ishaan1013.workers.dev/api/sandbox",
{