From abcefb081aa8646e9d0e48bcf2861a61ac593637 Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Tue, 25 Nov 2025 12:09:36 -0800 Subject: [PATCH] refactor: remove BuildsPanel and ProfileTargets componentss (unused) --- src/components/BuildsPanel.tsx | 108 ------------------------------ src/components/ProfileTargets.tsx | 25 ------- 2 files changed, 133 deletions(-) delete mode 100644 src/components/BuildsPanel.tsx delete mode 100644 src/components/ProfileTargets.tsx diff --git a/src/components/BuildsPanel.tsx b/src/components/BuildsPanel.tsx deleted file mode 100644 index aedcb27..0000000 --- a/src/components/BuildsPanel.tsx +++ /dev/null @@ -1,108 +0,0 @@ -import { useMutation, useQuery } from 'convex/react' -import { CheckCircle, Loader2, Trash2, XCircle } from 'lucide-react' -import { Link } from 'react-router-dom' -import { toast } from 'sonner' -import { Button } from '@/components/ui/button' -import { humanizeStatus, timeAgo } from '@/lib/utils' -import { api } from '../../convex/_generated/api' -import type { Id } from '../../convex/_generated/dataModel' - -interface BuildsPanelProps { - profileId: Id<'profiles'> -} - -export default function BuildsPanel({ profileId }: BuildsPanelProps) { - const builds = useQuery(api.builds.listByProfile, { profileId }) - const deleteBuild = useMutation(api.builds.deleteBuild) - - const getStatusIcon = (status: string) => { - if (status === 'success') { - return - } - if (status === 'failure') { - return - } - // All other statuses show as in progress - return - } - - const getStatusColor = (status: string) => { - if (status === 'success') { - return 'text-green-400' - } - if (status === 'failure') { - return 'text-red-400' - } - // All other statuses show as in progress - return 'text-blue-400' - } - - const handleDelete = async (buildId: Id<'builds'>) => { - try { - await deleteBuild({ buildId, profileId }) - toast.success('Build deleted', { - description: 'Build record has been removed.', - }) - } catch (error) { - toast.error('Delete failed', { - description: String(error), - }) - } - } - - if (!builds || builds.length === 0) { - return ( -
- No builds yet. Click "Build" to start. -
- ) - } - - return ( -
-

Build Status

-
- {builds.map((build) => ( -
- - {getStatusIcon(build.status)} - - {build.target} - - - {humanizeStatus(build.status)} - - - {timeAgo(build.startedAt)} - - - -
- -
-
- ))} -
-
- ) -} diff --git a/src/components/ProfileTargets.tsx b/src/components/ProfileTargets.tsx deleted file mode 100644 index 62488b4..0000000 --- a/src/components/ProfileTargets.tsx +++ /dev/null @@ -1,25 +0,0 @@ -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(', ')} - - ) -}