-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from supabase-community/feat/new-design
New design
- Loading branch information
Showing
49 changed files
with
3,231 additions
and
1,618 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,50 @@ | ||
import { Brain } from 'lucide-react' | ||
import { useApp } from '~/components/app-provider' | ||
import { Button } from '~/components/ui/button' | ||
import { cn } from '~/lib/utils' | ||
import { Tooltip, TooltipContent, TooltipTrigger } from '~/components/ui/tooltip' | ||
|
||
export type ByoLlmButtonProps = { | ||
onClick?: () => void | ||
className?: string | ||
size?: 'default' | 'sm' | 'lg' | 'icon' | ||
iconOnly?: boolean | ||
} | ||
|
||
export default function ByoLlmButton({ onClick }: ByoLlmButtonProps) { | ||
const { setIsModelProviderDialogOpen } = useApp() | ||
export default function ByoLlmButton({ | ||
onClick, | ||
className, | ||
size = 'default', | ||
iconOnly = false, | ||
}: ByoLlmButtonProps) { | ||
const { setIsModelProviderDialogOpen, modelProvider } = useApp() | ||
|
||
return ( | ||
const button = ( | ||
<Button | ||
className="gap-2 text-base" | ||
className={cn('gap-2 text-sm flex justify-center items-center relative', className)} | ||
variant="outline" | ||
size={iconOnly ? 'sm' : size} | ||
onClick={() => { | ||
onClick?.() | ||
setIsModelProviderDialogOpen(true) | ||
}} | ||
> | ||
<Brain size={18} strokeWidth={2} /> | ||
Bring your own LLM | ||
{modelProvider?.state?.enabled && ( | ||
<div className="absolute top-1 right-1 w-2 h-2 rounded-full bg-green-500" /> | ||
)} | ||
<Brain size={16} strokeWidth={1.5} /> | ||
{!iconOnly && 'Bring your own LLM'} | ||
</Button> | ||
) | ||
|
||
if (iconOnly) { | ||
return ( | ||
<Tooltip> | ||
<TooltipTrigger asChild>{button}</TooltipTrigger> | ||
<TooltipContent>Bring your own LLM</TooltipContent> | ||
</Tooltip> | ||
) | ||
} | ||
|
||
return button | ||
} |
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
Oops, something went wrong.