nit: format

This commit is contained in:
msukkari 2025-07-27 13:44:58 -07:00
parent 463477c85e
commit bfb9352d24

View file

@ -83,88 +83,88 @@ export const AgenticSearch = ({
</div> </div>
{demoExamples && ( {demoExamples && (
<div className="w-full mt-8 grid grid-cols-1 lg:grid-cols-2 gap-8 px-4 max-w-[1200px]"> <div className="w-full mt-8 grid grid-cols-1 lg:grid-cols-2 gap-8 px-4 max-w-[1200px]">
{/* Example Searches Column */} {/* Example Searches Column */}
<div className="space-y-4"> <div className="space-y-4">
<div className="flex items-center gap-2 mb-6"> <div className="flex items-center gap-2 mb-6">
<Search className="h-5 w-5 text-muted-foreground" /> <Search className="h-5 w-5 text-muted-foreground" />
<h3 className="text-lg font-semibold">Example Searches</h3> <h3 className="text-lg font-semibold">Example Searches</h3>
</div> </div>
<div className="space-y-3"> <div className="space-y-3">
{demoExamples.searchExamples.map((example) => ( {demoExamples.searchExamples.map((example) => (
<Card
key={example.id}
className="cursor-pointer transition-all duration-200 hover:shadow-md hover:border-primary/50 group"
onClick={() => handleExampleClick(example)}
>
<CardContent className="p-4">
<div className="flex items-start gap-3">
<div className="flex-shrink-0 p-2 rounded-lg bg-primary/10 text-primary group-hover:bg-primary group-hover:text-primary-foreground transition-colors">
{example.icon}
</div>
<div className="flex-1 min-w-0">
<h4 className="font-medium text-sm mb-1 group-hover:text-primary transition-colors">
{example.title}
</h4>
<p className="text-xs text-muted-foreground mb-2">{example.description}</p>
<Badge className="text-xs">
{example.category}
</Badge>
</div>
</div>
</CardContent>
</Card>
))}
</div>
</div>
{/* Search Contexts Column */}
<div className="space-y-4">
<div className="flex items-center gap-2 mb-6">
<Layers className="h-5 w-5 text-muted-foreground" />
<h3 className="text-lg font-semibold">Search Contexts</h3>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-1 xl:grid-cols-2 gap-3">
{demoExamples.searchContextExamples.map((context) => {
const searchContext = searchContexts.find((item) => item.name === context.name);
if (!searchContext) return null;
const isSelected = false; //selectedItems.some((item) => item.id === context.id)
const numRepos = searchContext.repoNames.length;
return (
<Card <Card
key={context.id} key={example.id}
className={`cursor-pointer transition-all duration-200 hover:shadow-md group ${isSelected ? "border-primary bg-primary/5 shadow-sm" : "hover:border-primary/50" className="cursor-pointer transition-all duration-200 hover:shadow-md hover:border-primary/50 group"
}`} onClick={() => handleExampleClick(example)}
onClick={() => handleContextClick(context)}
> >
<CardContent className="p-4"> <CardContent className="p-4">
<div className="flex items-start gap-3"> <div className="flex items-start gap-3">
<div <div className="flex-shrink-0 p-2 rounded-lg bg-primary/10 text-primary group-hover:bg-primary group-hover:text-primary-foreground transition-colors">
className={`flex-shrink-0 p-2 rounded-lg ${context.color} transition-transform group-hover:scale-105`} {example.icon}
>
{context.icon}
</div> </div>
<div className="flex-1 min-w-0"> <div className="flex-1 min-w-0">
<h4 <h4 className="font-medium text-sm mb-1 group-hover:text-primary transition-colors">
className={`font-medium text-sm mb-1 transition-colors ${isSelected ? "text-primary" : "group-hover:text-primary" {example.title}
}`}
>
{context.displayName}
</h4> </h4>
<p className="text-xs text-muted-foreground mb-2">{context.description}</p> <p className="text-xs text-muted-foreground mb-2">{example.description}</p>
<Badge className="text-xs"> <Badge className="text-xs">
{numRepos} repos {example.category}
</Badge> </Badge>
</div> </div>
</div> </div>
</CardContent> </CardContent>
</Card> </Card>
) ))}
})} </div>
</div>
{/* Search Contexts Column */}
<div className="space-y-4">
<div className="flex items-center gap-2 mb-6">
<Layers className="h-5 w-5 text-muted-foreground" />
<h3 className="text-lg font-semibold">Search Contexts</h3>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-1 xl:grid-cols-2 gap-3">
{demoExamples.searchContextExamples.map((context) => {
const searchContext = searchContexts.find((item) => item.name === context.name);
if (!searchContext) return null;
const isSelected = false; //selectedItems.some((item) => item.id === context.id)
const numRepos = searchContext.repoNames.length;
return (
<Card
key={context.id}
className={`cursor-pointer transition-all duration-200 hover:shadow-md group ${isSelected ? "border-primary bg-primary/5 shadow-sm" : "hover:border-primary/50"
}`}
onClick={() => handleContextClick(context)}
>
<CardContent className="p-4">
<div className="flex items-start gap-3">
<div
className={`flex-shrink-0 p-2 rounded-lg ${context.color} transition-transform group-hover:scale-105`}
>
{context.icon}
</div>
<div className="flex-1 min-w-0">
<h4
className={`font-medium text-sm mb-1 transition-colors ${isSelected ? "text-primary" : "group-hover:text-primary"
}`}
>
{context.displayName}
</h4>
<p className="text-xs text-muted-foreground mb-2">{context.description}</p>
<Badge className="text-xs">
{numRepos} repos
</Badge>
</div>
</div>
</CardContent>
</Card>
)
})}
</div>
</div> </div>
</div> </div>
</div>
)} )}
</div > </div >
) )