Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

replace badges

Jonathan Summers-Muirb63bbcde95a0
diff --git a/packages/ui/src/components/Command/Command.Badges.tsx b/packages/ui/src/components/Command/Command.Badges.tsx
new file mode 100644
index 00000000000..b78a1121a9d
--- /dev/null
+++ b/packages/ui/src/components/Command/Command.Badges.tsx
@@ -0,0 +1,10 @@
+import { Badge } from 'ui'
+import { Microscope } from 'lucide-react'
+
+export const BadgeExperimental = () => {
+ return (
+ <Badge color="scale">
+ <Microscope className="!mr-1.5 !w-3.5 !h-3.5" /> Experimental
+ </Badge>
+ )
+}
diff --git a/packages/ui/src/components/Command/Command.utils.tsx b/packages/ui/src/components/Command/Command.utils.tsx
index c9b2c14b23e..abb1cea0c9b 100644
--- a/packages/ui/src/components/Command/Command.utils.tsx
+++ b/packages/ui/src/components/Command/Command.utils.tsx
@@ -180,7 +180,7 @@ type CommandPrimitiveItemProps = React.ComponentPropsWithoutRef<typeof CommandPr
export interface CommandItemProps extends CommandPrimitiveItemProps {
type: 'link' | 'block-link' | 'command'
- badge?: string
+ badge?: React.ReactNode
}
export const CommandItem = React.forwardRef<CommandPrimitiveItemElement, CommandItemProps>(
@@ -242,11 +242,7 @@ export const CommandItem = React.forwardRef<CommandPrimitiveItemElement, Command
>
<div className="w-full flex flex-row justify-between items-center">
<div className="flex flex-row items-center">{children}</div>
- {badge && (
- <span className="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-opacity-10 bg-brand-200 text-brand-1100 border border-brand-700">
- {badge}
- </span>
- )}
+ {badge}
</div>
</CommandPrimitive.Item>
)
diff --git a/packages/ui/src/components/Command/CommandMenu.tsx b/packages/ui/src/components/Command/CommandMenu.tsx
index 5a133b40668..e22e6fab199 100644
--- a/packages/ui/src/components/Command/CommandMenu.tsx
+++ b/packages/ui/src/components/Command/CommandMenu.tsx
@@ -33,6 +33,7 @@ import ThemeOptions from './ThemeOptions'
import APIKeys from './APIKeys'
import SearchableStudioItems from './SearchableStudioItems'
import CommandMenuShortcuts from './CommandMenuShortcuts'
+import { BadgeExperimental } from './Command.Badges'
export const CHAT_ROUTES = [
COMMAND_ROUTES.AI, // this one is temporary
@@ -91,7 +92,7 @@ const CommandMenu = ({ projectRef }: CommandMenuProps) => {
<CommandGroup heading="Documentation" forceMount>
<CommandItem
type="command"
- badge="Experimental"
+ badge={<BadgeExperimental />}
onSelect={() => {
setPages([...pages, COMMAND_ROUTES.AI])
}}
@@ -175,7 +176,7 @@ const CommandMenu = ({ projectRef }: CommandMenuProps) => {
<CommandItem
forceMount
type="command"
- badge="Experimental"
+ badge={<BadgeExperimental />}
onSelect={() => setPages([...pages, COMMAND_ROUTES.GENERATE_SQL])}
>
<AiIcon className="text-scale-1100" />
diff --git a/packages/ui/src/components/Command/CommandMenuShortcuts.tsx b/packages/ui/src/components/Command/CommandMenuShortcuts.tsx
index 873c70b93d4..34096855c07 100644
--- a/packages/ui/src/components/Command/CommandMenuShortcuts.tsx
+++ b/packages/ui/src/components/Command/CommandMenuShortcuts.tsx
@@ -1,6 +1,6 @@
import { IconArrowLeft } from '../Icon/icons/IconArrowLeft'
-import { Badge } from 'ui'
+import { BadgeExperimental } from './Command.Badges'
import { COMMAND_ROUTES } from './Command.constants'
import { CommandShortcut } from './Command.utils'
import { useCommandMenu } from './CommandMenuProvider'
@@ -32,11 +32,7 @@ export default function CommandMenuShortcuts() {
</CommandShortcut>
))}
- {currentPage && isExperimental(currentPage) && (
- <Badge dot color="scale">
- Experimental
- </Badge>
- )}
+ {currentPage && isExperimental(currentPage) && <BadgeExperimental />}
</div>
</div>
)