-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(assistants): Add "Discover Assistant" Page (#222)
* feat(assistant): DiscoverAgents UI * merge main * improve animation for agents side panel
- Loading branch information
Showing
6 changed files
with
264 additions
and
46 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
src/interfaces/coral_web/src/components/Agents/DiscoverAgentCard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import Link from 'next/link'; | ||
|
||
import { Button, CoralLogo, Icon, Text } from '@/components/Shared'; | ||
import { cn } from '@/utils'; | ||
import { getCohereColor } from '@/utils/getCohereColor'; | ||
|
||
type Props = { | ||
name: string; | ||
description: string; | ||
isBaseAgent?: boolean; | ||
id?: string; | ||
}; | ||
|
||
/** | ||
* @description renders a card for an agent with the agent's name, description | ||
*/ | ||
export const DiscoverAgentCard: React.FC<Props> = ({ id, name, description, isBaseAgent }) => { | ||
return ( | ||
<article className="flex overflow-x-hidden rounded-lg border border-marble-400 bg-marble-200 p-4 hover:bg-marble-300"> | ||
<Link | ||
href={isBaseAgent ? '/agents' : `/agents?id=${id}`} | ||
className="flex-grow overflow-x-hidden" | ||
> | ||
<div className="flex h-full flex-col items-start gap-y-2"> | ||
<div className="flex w-full items-center gap-x-2"> | ||
<div | ||
className={cn( | ||
'flex h-8 w-8 flex-shrink-0 items-center justify-center rounded duration-300', | ||
'truncate', | ||
id && getCohereColor(id), | ||
{ | ||
'bg-secondary-400': isBaseAgent, | ||
} | ||
)} | ||
> | ||
{isBaseAgent ? ( | ||
<CoralLogo style="secondary" /> | ||
) : ( | ||
<Text className="uppercase text-white" styleAs="p-lg"> | ||
{name[0]} | ||
</Text> | ||
)} | ||
</div> | ||
<Text as="h5" className="truncate"> | ||
{name} | ||
</Text> | ||
</div> | ||
<Text className="line-clamp-2 flex-grow break-all text-left">{description}</Text> | ||
<Button | ||
className="ml-auto" | ||
label={<Text className="text-green-700">Try now</Text>} | ||
kind="secondary" | ||
endIcon={<Icon name="arrow-up-right" className="text-green-700" />} | ||
/> | ||
</div> | ||
</Link> | ||
</article> | ||
); | ||
}; |
Oops, something went wrong.