Skip to content

Commit 263cba3

Browse files
committed
refactor: extract shared RepoTab type to types.ts, remove duplication
RepoTab was defined identically in both DashboardHome.tsx and RepoDetailView.tsx. Moved to types.ts as single source of truth.
1 parent 5f0e101 commit 263cba3

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

frontend/src/components/dashboard/DashboardHome.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import { GitHubRepoSelector } from '../GitHubRepoSelector'
1616
import { IndexingProgressModal } from '../IndexingProgressModal'
1717
import { UpgradeLimitModal } from '../UpgradeLimitModal'
1818
import type { GitHubRepo } from '../../hooks/useGitHubRepos'
19-
20-
type RepoTab = 'overview' | 'search' | 'dependencies' | 'insights' | 'impact'
19+
import type { RepoTab } from '../../types'
2120

2221
export function DashboardHome() {
2322
const { session } = useAuth()

frontend/src/components/dashboard/RepoDetailView.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ import { DependencyGraph } from '../DependencyGraph'
1717
import { RepoOverview } from '../RepoOverview'
1818
import { StyleInsights } from '../StyleInsights'
1919
import { ImpactAnalyzer } from '../ImpactAnalyzer'
20-
import type { Repository } from '../../types'
20+
import type { Repository, RepoTab } from '../../types'
2121
import { API_URL } from '../../config/api'
2222

23-
type RepoTab = 'overview' | 'search' | 'dependencies' | 'insights' | 'impact'
24-
2523
const TABS = [
2624
{ id: 'overview', label: 'Overview', icon: LayoutDashboard },
2725
{ id: 'search', label: 'Search', icon: Search },

frontend/src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ export interface SearchResult {
1717
line_start: number
1818
line_end: number
1919
}
20+
21+
export type RepoTab = 'overview' | 'search' | 'dependencies' | 'insights' | 'impact'

0 commit comments

Comments
 (0)