- {/* Category Pills */}
-
- {categories.map((category) => {
- const count = groupedTargets[category].filter((t) =>
- targets?.includes(t.id)
- ).length
- const isActive = activeCategory === category
-
- return (
-
- )
- })}
-
-
- {/* Active Category Targets */}
-
-
- {groupedTargets[activeCategory]?.map((item) => (
-
- toggleTarget(item.id)}
- />
-
-
- ))}
-
-
+
+ setValue('isPublic', !!checked)}
+ disabled
+ />
+
+
+ Public profiles are visible to everyone on the home page
+
diff --git a/src/components/ProfileTargets.tsx b/src/components/ProfileTargets.tsx
new file mode 100644
index 0000000..7043aad
--- /dev/null
+++ b/src/components/ProfileTargets.tsx
@@ -0,0 +1,26 @@
+import { useQuery } from 'convex/react'
+import { api } from '../../convex/_generated/api'
+import type { Id } from '../../convex/_generated/dataModel'
+
+interface ProfileTargetsProps {
+ profileId: Id<'profiles'>
+}
+
+export default function ProfileTargets({ profileId }: ProfileTargetsProps) {
+ const targets = useQuery(api.profiles.getTargets, { profileId })
+
+ if (targets === undefined) {
+ return
Loading...
+ }
+
+ if (targets.length === 0) {
+ return
No targets
+ }
+
+ return (
+
+ Targets: {targets.join(', ')}
+
+ )
+}
+
diff --git a/src/pages/Dashboard.tsx b/src/pages/Dashboard.tsx
index 11b10ba..84f8820 100644
--- a/src/pages/Dashboard.tsx
+++ b/src/pages/Dashboard.tsx
@@ -1,16 +1,15 @@
-import { useAuthActions } from '@convex-dev/auth/react'
import { useMutation, useQuery } from 'convex/react'
import { Plus, Trash2 } from 'lucide-react'
import { useState } from 'react'
import { toast } from 'sonner'
import BuildsPanel from '@/components/BuildsPanel'
import ProfileEditor from '@/components/ProfileEditor'
+import ProfileTargets from '@/components/ProfileTargets'
import { Button } from '@/components/ui/button'
import { api } from '../../convex/_generated/api'
import type { Doc, Id } from '../../convex/_generated/dataModel'
export default function Dashboard() {
- const { signOut } = useAuthActions()
const profiles = useQuery(api.profiles.list)
const triggerBuild = useMutation(api.builds.triggerBuild)
const removeProfile = useMutation(api.profiles.remove)
@@ -70,17 +69,12 @@ export default function Dashboard() {
My Fleet
-
-
-
-
+
@@ -103,7 +97,7 @@ export default function Dashboard() {
{profile.version}
- Targets: {profile.targets.join(', ')}
+