Skip to content

Commit fba47c4

Browse files
committed
fix: Now when a repository dont have an sbom is shown correctly
1 parent 6b96901 commit fba47c4

File tree

15 files changed

+287
-321
lines changed

15 files changed

+287
-321
lines changed

app/[locale]/docs/page.tsx

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ import {
99
import { FileText } from 'lucide-react'
1010
import Image from 'next/image'
1111
import { getDictionary, type Locale } from '@/lib/i18n'
12-
import { Navigation, HeroSection, OverviewSection, DocsTabs } from '@/components/feature/docs/shared'
12+
import {
13+
Navigation,
14+
HeroSection,
15+
OverviewSection,
16+
DocsTabs,
17+
} from '@/components/feature/docs/shared'
1318
import {
1419
AuthTab,
1520
GraphTab,
@@ -47,7 +52,7 @@ export default async function DocsPage({ params }: PageProps) {
4752
<Navigation t={t} locale={locale} />
4853

4954
{/* Hero Section */}
50-
<HeroSection t={t} locale={locale} />
55+
<HeroSection t={t} />
5156

5257
{/* Main Content */}
5358
<section className="py-8 sm:py-12 lg:py-16 px-4">
@@ -65,22 +70,13 @@ export default async function DocsPage({ params }: PageProps) {
6570
<VexgenTab vexgenEndpoints={vexgenEndpoints} t={t} />
6671

6772
{/* Graph Tab */}
68-
<GraphTab
69-
depexRepositoryEndpoints={depexGraphEndpoints}
70-
t={t}
71-
/>
73+
<GraphTab depexRepositoryEndpoints={depexGraphEndpoints} t={t} />
7274

7375
{/* File Operations Tab */}
74-
<FileOpsTab
75-
depexFileOperationEndpoints={depexFileOperationEndpoints}
76-
t={t}
77-
/>
76+
<FileOpsTab depexFileOperationEndpoints={depexFileOperationEndpoints} t={t} />
7877

7978
{/* Config Operations Tab */}
80-
<ConfigOpsTab
81-
depexConfigOperationEndpoints={depexConfigOperationEndpoints}
82-
t={t}
83-
/>
79+
<ConfigOpsTab depexConfigOperationEndpoints={depexConfigOperationEndpoints} t={t} />
8480

8581
{/* Schemas Tab */}
8682
<TabsContent value="schemas" className="mt-4 sm:mt-6">

components/feature/docs/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ export { ConfigOpsTab } from './tabs/ConfigOpsTab'
88
// Shared components
99
export { EndpointCard } from './shared/EndpointCard'
1010
export { OverviewSection } from './shared/OverviewSection'
11-
export { EcosystemsSection } from './shared/EcosystemsSection'

components/feature/docs/shared/DocsTabs.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
'use client'
22

33
import { useEffect, useState } from 'react'
4-
import { useRouter } from 'next/navigation'
5-
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui'
4+
import { Tabs, TabsList, TabsTrigger } from '@/components/ui'
65

76
interface DocsTabsProps {
87
children: React.ReactNode
@@ -11,12 +10,14 @@ interface DocsTabsProps {
1110

1211
export function DocsTabs({ children, t }: DocsTabsProps) {
1312
const [activeTab, setActiveTab] = useState('overview')
14-
const router = useRouter()
1513

1614
// Read the hash from URL on mount
1715
useEffect(() => {
1816
const hash = window.location.hash.replace('#', '')
19-
if (hash && ['overview', 'auth', 'vexgen', 'graph', 'file-ops', 'config-ops', 'schemas'].includes(hash)) {
17+
if (
18+
hash &&
19+
['overview', 'auth', 'vexgen', 'graph', 'file-ops', 'config-ops', 'schemas'].includes(hash)
20+
) {
2021
setActiveTab(hash)
2122
}
2223
}, [])
@@ -42,9 +43,7 @@ export function DocsTabs({ children, t }: DocsTabsProps) {
4243
</TabsTrigger>
4344
<TabsTrigger value="vexgen" className="text-xs sm:text-sm py-2 px-1 sm:px-3">
4445
<span className="lg:hidden">VEX/TIX</span>
45-
<span className="hidden lg:inline">
46-
{(t as any).vexgen?.tabTitle || 'VEX & TIX'}
47-
</span>
46+
<span className="hidden lg:inline">{(t as any).vexgen?.tabTitle || 'VEX & TIX'}</span>
4847
</TabsTrigger>
4948
<TabsTrigger value="graph" className="text-xs sm:text-sm py-2 px-1 sm:px-3">
5049
<span className="lg:hidden">{t.docs.graph}</span>

components/feature/docs/shared/EndpointCard.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@ export const EndpointCard: React.FC<EndpointCardProps> = ({ endpoint, index, t }
3030
return 'bg-gray-100 text-gray-800 border-gray-200 dark:bg-gray-900 dark:text-gray-300 dark:border-gray-700'
3131
}
3232
}
33-
33+
3434
const methodColorClasses = getMethodColorClasses(endpoint.method)
35-
35+
3636
return (
3737
<div key={index} className="border rounded-lg p-3 sm:p-4">
3838
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2">
3939
<div className="flex items-center gap-2 sm:gap-3 min-w-0">
40-
<span className={`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold border ${methodColorClasses}`}>
40+
<span
41+
className={`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold border ${methodColorClasses}`}
42+
>
4143
{endpoint.method}
4244
</span>
4345
<code className="text-xs sm:text-sm font-mono break-all">{endpoint.path}</code>

components/feature/docs/shared/HeroSection.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ import { BookOpen, ExternalLink } from 'lucide-react'
33

44
interface HeroSectionProps {
55
t: any
6-
locale: string
76
}
87

9-
export const HeroSection: React.FC<HeroSectionProps> = ({ t, locale }) => {
8+
export const HeroSection: React.FC<HeroSectionProps> = ({ t }) => {
109
return (
1110
<section className="py-8 sm:py-12 lg:py-16 px-4 bg-gradient-to-br from-primary/10 via-background to-secondary/10">
1211
<div className="container mx-auto text-center">

components/feature/docs/tabs/AuthTab.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,7 @@ export const AuthTab: React.FC<AuthTabProps> = ({ authEndpoints, t }) => {
3030
<CardContent>
3131
<div className="space-y-3 sm:space-y-4">
3232
{authEndpoints.map((endpoint, index) => (
33-
<EndpointCard
34-
key={index}
35-
endpoint={endpoint}
36-
index={index}
37-
t={t}
38-
/>
33+
<EndpointCard key={index} endpoint={endpoint} index={index} t={t} />
3934
))}
4035
</div>
4136
</CardContent>

components/feature/docs/tabs/ConfigOpsTab.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ interface ConfigOpsTabProps {
1515
t: any
1616
}
1717

18-
export const ConfigOpsTab: React.FC<ConfigOpsTabProps> = ({
19-
depexConfigOperationEndpoints,
20-
t,
21-
}) => {
18+
export const ConfigOpsTab: React.FC<ConfigOpsTabProps> = ({ depexConfigOperationEndpoints, t }) => {
2219
return (
2320
<TabsContent value="config-ops" className="mt-4 sm:mt-6">
2421
<div className="space-y-4 sm:space-y-6">
@@ -35,12 +32,7 @@ export const ConfigOpsTab: React.FC<ConfigOpsTabProps> = ({
3532
<CardContent>
3633
<div className="space-y-3 sm:space-y-4">
3734
{depexConfigOperationEndpoints.map((endpoint, index) => (
38-
<EndpointCard
39-
key={index}
40-
endpoint={endpoint}
41-
index={index}
42-
t={t}
43-
/>
35+
<EndpointCard key={index} endpoint={endpoint} index={index} t={t} />
4436
))}
4537
</div>
4638
</CardContent>

components/feature/docs/tabs/FileOpsTab.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ interface FileOpsTabProps {
1515
t: any
1616
}
1717

18-
export const FileOpsTab: React.FC<FileOpsTabProps> = ({
19-
depexFileOperationEndpoints,
20-
t,
21-
}) => {
18+
export const FileOpsTab: React.FC<FileOpsTabProps> = ({ depexFileOperationEndpoints, t }) => {
2219
return (
2320
<TabsContent value="file-ops" className="mt-4 sm:mt-6">
2421
<div className="space-y-4 sm:space-y-6">
@@ -35,12 +32,7 @@ export const FileOpsTab: React.FC<FileOpsTabProps> = ({
3532
<CardContent>
3633
<div className="space-y-3 sm:space-y-4">
3734
{depexFileOperationEndpoints.map((endpoint, index) => (
38-
<EndpointCard
39-
key={index}
40-
endpoint={endpoint}
41-
index={index}
42-
t={t}
43-
/>
35+
<EndpointCard key={index} endpoint={endpoint} index={index} t={t} />
4436
))}
4537
</div>
4638
</CardContent>

components/feature/docs/tabs/GraphTab.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ interface GraphTabProps {
1515
t: any
1616
}
1717

18-
export const GraphTab: React.FC<GraphTabProps> = ({
19-
depexRepositoryEndpoints,
20-
t,
21-
}) => {
18+
export const GraphTab: React.FC<GraphTabProps> = ({ depexRepositoryEndpoints, t }) => {
2219
return (
2320
<TabsContent value="graph" className="mt-4 sm:mt-6">
2421
<div className="space-y-4 sm:space-y-6">
@@ -35,12 +32,7 @@ export const GraphTab: React.FC<GraphTabProps> = ({
3532
<CardContent>
3633
<div className="space-y-3 sm:space-y-4">
3734
{depexRepositoryEndpoints.map((endpoint, index) => (
38-
<EndpointCard
39-
key={index}
40-
endpoint={endpoint}
41-
index={index}
42-
t={t}
43-
/>
35+
<EndpointCard key={index} endpoint={endpoint} index={index} t={t} />
4436
))}
4537
</div>
4638
</CardContent>

components/feature/docs/tabs/VexgenTab.tsx

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ export const VexgenTab: React.FC<VexgenTabProps> = ({ vexgenEndpoints, t }) => {
2525
<FileText className="h-4 w-4 sm:h-5 sm:w-5" />
2626
{t.docs.vexgen.title}
2727
</CardTitle>
28-
<CardDescription className="text-sm">
29-
{t.docs.vexgen.description}
30-
</CardDescription>
28+
<CardDescription className="text-sm">{t.docs.vexgen.description}</CardDescription>
3129
</CardHeader>
3230
<CardContent>
3331
<div className="space-y-6">
@@ -41,12 +39,7 @@ export const VexgenTab: React.FC<VexgenTabProps> = ({ vexgenEndpoints, t }) => {
4139
{vexgenEndpoints
4240
.filter(endpoint => endpoint.tag === 'VEX')
4341
.map((endpoint, index) => (
44-
<EndpointCard
45-
key={index}
46-
endpoint={endpoint}
47-
index={index}
48-
t={t}
49-
/>
42+
<EndpointCard key={index} endpoint={endpoint} index={index} t={t} />
5043
))}
5144
</div>
5245
</div>
@@ -61,12 +54,7 @@ export const VexgenTab: React.FC<VexgenTabProps> = ({ vexgenEndpoints, t }) => {
6154
{vexgenEndpoints
6255
.filter(endpoint => endpoint.tag === 'TIX')
6356
.map((endpoint, index) => (
64-
<EndpointCard
65-
key={index}
66-
endpoint={endpoint}
67-
index={index}
68-
t={t}
69-
/>
57+
<EndpointCard key={index} endpoint={endpoint} index={index} t={t} />
7058
))}
7159
</div>
7260
</div>
@@ -81,12 +69,7 @@ export const VexgenTab: React.FC<VexgenTabProps> = ({ vexgenEndpoints, t }) => {
8169
{vexgenEndpoints
8270
.filter(endpoint => endpoint.tag === 'Generation')
8371
.map((endpoint, index) => (
84-
<EndpointCard
85-
key={index}
86-
endpoint={endpoint}
87-
index={index}
88-
t={t}
89-
/>
72+
<EndpointCard key={index} endpoint={endpoint} index={index} t={t} />
9073
))}
9174
</div>
9275
</div>

0 commit comments

Comments
 (0)