Skip to content

Commit 94e17b4

Browse files
committed
Fix linter errors and add missing skeleton component - Fixed all quote escaping issues in embeddings demo - Added missing skeleton UI component - Build now passes cleanly with no errors
1 parent e2a58c4 commit 94e17b4

File tree

3 files changed

+97
-6
lines changed

3 files changed

+97
-6
lines changed

src/app/demos/embeddings/EmbeddingsDemoClient.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,8 @@ export default function EmbeddingsDemoClient() {
552552
<div className="bg-zinc-100 dark:bg-zinc-700 p-4 rounded-lg">
553553
<h4 className="font-medium mb-2">🔍 Smart Search</h4>
554554
<p className="text-sm text-zinc-600 dark:text-zinc-400">
555-
Search for "car" and find results about "automobile" or "vehicle"
556-
even if they don't contain the exact word.
555+
Search for &quot;car&quot; and find results about &quot;automobile&quot; or &quot;vehicle&quot;
556+
even if they don&apos;t contain the exact word.
557557
</p>
558558
</div>
559559
<div className="bg-zinc-100 dark:bg-zinc-700 p-4 rounded-lg">
@@ -567,14 +567,14 @@ export default function EmbeddingsDemoClient() {
567567
<h4 className="font-medium mb-2">📱 Recommendations</h4>
568568
<p className="text-sm text-zinc-600 dark:text-zinc-400">
569569
Netflix, Spotify, and shopping sites use embeddings to suggest
570-
content similar to what you've enjoyed before.
570+
content similar to what you&apos;ve enjoyed before.
571571
</p>
572572
</div>
573573
<div className="bg-zinc-100 dark:bg-zinc-700 p-4 rounded-lg">
574574
<h4 className="font-medium mb-2">🌐 Translation</h4>
575575
<p className="text-sm text-zinc-600 dark:text-zinc-400">
576-
Google Translate uses embeddings to understand that "hello" in English
577-
has the same meaning as "hola" in Spanish.
576+
Google Translate uses embeddings to understand that &quot;hello&quot; in English
577+
has the same meaning as &quot;hola&quot; in Spanish.
578578
</p>
579579
</div>
580580
</div>
@@ -754,7 +754,7 @@ export default function EmbeddingsDemoClient() {
754754
onClick={() => handleComparisonExample(text1, text2)}
755755
className="px-3 py-1 text-xs bg-green-100 dark:bg-green-900 hover:bg-green-200 dark:hover:bg-green-800 rounded-md"
756756
>
757-
"{text1}" vs "{text2}"
757+
&quot;{text1}&quot; vs &quot;{text2}&quot;
758758
</button>
759759
))}
760760
</div>

src/components/ui/skeleton.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { cn } from "@/lib/utils"
2+
3+
function Skeleton({
4+
className,
5+
...props
6+
}: React.HTMLAttributes<HTMLDivElement>) {
7+
return (
8+
<div
9+
className={cn("animate-pulse rounded-md bg-muted", className)}
10+
{...props}
11+
/>
12+
)
13+
}
14+
15+
export { Skeleton }

src/utils/comparison-helpers.ts

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
export interface Tool {
2+
name: string;
3+
slug: string;
4+
description: string;
5+
category: string;
6+
pricing?: string;
7+
features?: string[];
8+
pros?: string[];
9+
cons?: string[];
10+
website?: string;
11+
}
12+
13+
// Mock tool data - in a real app this would come from a database or API
14+
const tools: Tool[] = [
15+
{
16+
name: "GitHub Copilot",
17+
slug: "github-copilot",
18+
description: "AI-powered code completion and generation tool by GitHub",
19+
category: "Code Generation",
20+
pricing: "$10/month",
21+
features: ["Code completion", "Code generation", "Multi-language support"],
22+
pros: ["Excellent IDE integration", "High-quality suggestions", "Large training dataset"],
23+
cons: ["Subscription required", "Privacy concerns", "Can suggest outdated patterns"],
24+
website: "https://github.com/features/copilot"
25+
},
26+
{
27+
name: "Cursor",
28+
slug: "cursor",
29+
description: "AI-first code editor built for pair programming with AI",
30+
category: "Code Editor",
31+
pricing: "$20/month",
32+
features: ["AI chat", "Code editing", "Codebase understanding"],
33+
pros: ["Native AI integration", "Codebase awareness", "Modern interface"],
34+
cons: ["Newer tool", "Higher price", "Learning curve"],
35+
website: "https://cursor.sh"
36+
}
37+
];
38+
39+
export function getToolBySlug(slug: string): Tool | undefined {
40+
return tools.find(tool => tool.slug === slug);
41+
}
42+
43+
export function getAllTools(): Tool[] {
44+
return tools;
45+
}
46+
47+
export function getToolComparison(tool1Slug: string, tool2Slug: string) {
48+
const tool1 = getToolBySlug(tool1Slug);
49+
const tool2 = getToolBySlug(tool2Slug);
50+
51+
if (!tool1 || !tool2) {
52+
return null;
53+
}
54+
55+
return {
56+
tool1,
57+
tool2,
58+
comparisonTitle: `${tool1.name} vs ${tool2.name}`,
59+
comparisonDescription: `Compare ${tool1.name} and ${tool2.name} to find the best AI development tool for your needs.`
60+
};
61+
}
62+
63+
export function generateComparisonSlug(tool1: string, tool2: string): string {
64+
return `${tool1}-vs-${tool2}`;
65+
}
66+
67+
export function parseComparisonSlug(slug: string): { tool1: string; tool2: string } | null {
68+
const parts = slug.split('-vs-');
69+
if (parts.length !== 2) {
70+
return null;
71+
}
72+
return {
73+
tool1: parts[0],
74+
tool2: parts[1]
75+
};
76+
}

0 commit comments

Comments
 (0)