import { siPostgresql, siMysql, siMariadb, siSqlite, siRedis, siSupabase, siNeon, siPlanetscale } from "simple-icons"; import type { DbType } from "./types"; // Brand colors from simple-icons const DB_COLORS: Record = { postgresql: `#${siPostgresql.hex}`, mysql: `#${siMysql.hex}`, mariadb: `#${siMariadb.hex}`, redis: `#${siRedis.hex}`, sqlite: `#${siSqlite.hex}`, }; // SVG path data for each DB icon const DB_PATHS: Record = { postgresql: siPostgresql.path, mysql: siMysql.path, mariadb: siMariadb.path, redis: siRedis.path, sqlite: siSqlite.path, }; export const DB_LABELS: Record = { postgresql: "PostgreSQL", mysql: "MySQL", mariadb: "MariaDB", redis: "Redis", sqlite: "SQLite", }; interface DbIconProps { type: DbType; size?: number; className?: string; } export function DbIcon({ type, size = 20, className }: DbIconProps) { const path = DB_PATHS[type]; const color = DB_COLORS[type]; if (!path) return ❓; return ( ); } // Keep backward compat for any legacy emoji usage export const DB_ICONS: Record = { postgresql: "🐘", mysql: "🐬", mariadb: "🦭", redis: "⚡", sqlite: "🗄️", }; // ── Managed-PostgreSQL provider icons (Supabase, NeonDB) ────────── // These are NOT DbType values; connections persist as db_type="postgresql". type ProviderIconId = "supabase" | "neon" | "planetscale"; const PROVIDER_ICON_DATA: Record = { supabase: { hex: `#${siSupabase.hex}`, path: siSupabase.path }, neon: { hex: `#${siNeon.hex}`, path: siNeon.path }, planetscale: { hex: `#${siPlanetscale.hex}`, path: siPlanetscale.path }, }; export const PROVIDER_LABELS: Record = { supabase: "Supabase", neon: "NeonDB", planetscale: "PlanetScale", }; interface ProviderIconProps { id: ProviderIconId; size?: number; className?: string; } export function ProviderIcon({ id, size = 20, className }: ProviderIconProps) { const data = PROVIDER_ICON_DATA[id]; if (!data) return ❓; return ( ); }