refactor: Rename component pages to program pages and remove tools concept
The 'tools' concept was just a filtered view of programs and added unnecessary complexity to the frontend. This commit: - Removes ToolCard.tsx and Tools.tsx (pages/components never used in router) - Renames ComponentDetail.tsx → ProgramDetail.tsx (exports ProgramDetailPage) - Renames ComponentRedirect.tsx → ProgramRedirect.tsx (exports ProgramRedirect) - Updates imports in routes.tsx to match new file names - Fixes stale comment in hooks.ts Frontend naming now aligns with the unified programs model.
This commit is contained in:
@@ -6,7 +6,7 @@ import { DetailHeader } from "@/components/detail/DetailHeader"
|
||||
import { ConfigPanel } from "@/components/detail/ConfigPanel"
|
||||
import { ProgramActions, ActionOutputPanel, type ActionOutput } from "@/components/ProgramActions"
|
||||
|
||||
export function ComponentDetailPage() {
|
||||
export function ProgramDetailPage() {
|
||||
useEventStream()
|
||||
const { name } = useParams<{ name: string }>()
|
||||
const { data: component, isLoading, error, refetch } = useProgram(name ?? "")
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useParams, Navigate } from "react-router-dom"
|
||||
import { useComponent } from "@/services/api/hooks"
|
||||
|
||||
export function ComponentRedirect() {
|
||||
export function ProgramRedirect() {
|
||||
const { name } = useParams<{ name: string }>()
|
||||
const { data: component, isLoading, error } = useComponent(name ?? "")
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
import { Link } from "react-router-dom"
|
||||
import { ArrowLeft } from "lucide-react"
|
||||
import { usePrograms } from "@/services/api/hooks"
|
||||
import { ToolCard } from "@/components/ToolCard"
|
||||
|
||||
export function ToolsPage() {
|
||||
const { data: tools, isLoading } = usePrograms("tool")
|
||||
|
||||
return (
|
||||
<div className="max-w-6xl mx-auto px-6 py-8">
|
||||
<Link to="/" className="text-[var(--primary)] hover:underline flex items-center gap-1 mb-6">
|
||||
<ArrowLeft size={16} /> Back
|
||||
</Link>
|
||||
|
||||
<h1 className="text-3xl font-bold mb-2">Tools</h1>
|
||||
<p className="text-sm text-[var(--muted)] mb-8">
|
||||
CLI utilities installed to PATH via castle and run with uv.
|
||||
</p>
|
||||
|
||||
{isLoading ? (
|
||||
<p className="text-[var(--muted)]">Loading tools...</p>
|
||||
) : tools?.length ? (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
{tools.map((tool) => (
|
||||
<ToolCard key={tool.id} tool={tool} />
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-[var(--muted)]">No tools registered.</p>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user