Home / Function/ Command() — supabase Function Reference

Command() — supabase Function Reference

Architecture documentation for the Command() function in CommandRender.tsx from the supabase codebase.

Entity Profile

Relationship Graph

Source Code

apps/studio/components/interfaces/Functions/CommandRender.tsx lines 22–56

const Command = ({ item }: any) => {
  const [isCopied, setIsCopied] = useState(false)

  return (
    <div className="space-y-1">
      <span className="font-mono text-sm text-foreground-lighter">{`> ${item.comment}`}</span>
      <div className="flex items-center gap-2">
        <div className="flex gap-2 font-mono text-sm font-normal text-foreground">
          <span className="text-foreground-lighter">$</span>
          <span>
            <span>{item.jsx ? item.jsx() : null} </span>
            <button
              type="button"
              className="text-foreground-lighter hover:text-foreground"
              onClick={() => {
                function onCopy(value: any) {
                  setIsCopied(true)
                  copyToClipboard(value)
                  setTimeout(() => setIsCopied(false), 3000)
                }
                onCopy(item.command)
              }}
            >
              {isCopied ? (
                <Check size={14} strokeWidth={3} className="text-brand" />
              ) : (
                <Copy size={14} />
              )}
            </button>
          </span>
        </div>
      </div>
    </div>
  )
}

Subdomains

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free