()
| 21 | } |
| 22 | |
| 23 | function UserExtensions() { |
| 24 | const extensions = useQuery(api.extensions.listByAuthor) |
| 25 | |
| 26 | if (extensions === undefined) { |
| 27 | return ( |
| 28 | <div className="space-y-3"> |
| 29 | {[1, 2].map((i) => ( |
| 30 | <div |
| 31 | key={i} |
| 32 | className="h-20 animate-pulse rounded border border-[var(--color-border-weak)] bg-[var(--color-bg-weak)]" |
| 33 | /> |
| 34 | ))} |
| 35 | </div> |
| 36 | ) |
| 37 | } |
| 38 | |
| 39 | if (extensions.length === 0) { |
| 40 | return ( |
| 41 | <div className="rounded border border-[var(--color-border-weak)] bg-[var(--color-bg-weak)] p-6 text-center"> |
| 42 | <p className="mb-4 text-[var(--color-text-weak)]">You haven't submitted any extensions yet.</p> |
| 43 | <Link |
| 44 | href="/submit" |
| 45 | className="inline-flex items-center justify-center rounded bg-[var(--color-bg-strong)] px-4 py-2 text-sm font-medium text-[var(--color-text-inverted)] transition-colors hover:bg-[var(--color-bg-strong-hover)]" |
| 46 | > |
| 47 | Submit Your First Extension |
| 48 | </Link> |
| 49 | </div> |
| 50 | ) |
| 51 | } |
| 52 | |
| 53 | return ( |
| 54 | <div className="space-y-3"> |
| 55 | {extensions.map((ext) => ( |
| 56 | <div |
| 57 | key={ext._id} |
| 58 | className="flex items-center justify-between rounded border border-[var(--color-border-weak)] bg-[var(--color-bg-weak)] p-4" |
| 59 | > |
| 60 | <div className="flex flex-col gap-1"> |
| 61 | <div className="flex items-center gap-2"> |
| 62 | <Link |
| 63 | href={`/plugin/${ext.productId}`} |
| 64 | className="font-medium text-[var(--color-text-strong)] hover:underline" |
| 65 | > |
| 66 | {ext.displayName} |
| 67 | </Link> |
| 68 | <Badge |
| 69 | variant={ |
| 70 | ext.status === "approved" |
| 71 | ? "success" |
| 72 | : ext.status === "rejected" |
| 73 | ? "destructive" |
| 74 | : "warning" |
| 75 | } |
| 76 | > |
| 77 | {ext.status} |
| 78 | </Badge> |
| 79 | </div> |
| 80 | <span className="text-xs text-[var(--color-text-weak)]"> |
nothing calls this directly
no outgoing calls
no test coverage detected