Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
import { Unlink } from "lucide-react";
import { EngineIcon, getEngineIconSrc } from "@/components/EngineIcon";
import {
getConnectionForSQLEditorTab,
isConnectedSQLEditorTab,
} from "@/lib/sqlEditorConnection";
import type { SQLEditorTab } from "@/types";
type Props = {
readonly tab: SQLEditorTab;
};
/**
* Renders the engine icon when the tab has a live connection, otherwise the
* "unlink" glyph.
*/
export function SheetConnectionIcon({ tab }: Props) {
const connected = isConnectedSQLEditorTab(tab);
const { instance } = getConnectionForSQLEditorTab(tab);
if (connected && instance && getEngineIconSrc(instance.engine)) {
return <EngineIcon engine={instance.engine} className="size-4" />;
}
return <Unlink className="size-4 shrink-0" />;
}