File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ export default function LocalConnectionPage() {
3838 id : conn . id ,
3939 type : conn . content . driver ,
4040 status : "" ,
41+ color : conn . content . label || "default" ,
4142 } as ResourceItemProps ;
4243 } ) ;
4344 } , [ localBases ] ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { Input } from "@/components/orbit/input";
22import { MenuBar } from "@/components/orbit/menu-bar" ;
33import ResourceCard from "@/components/resource-card" ;
44import {
5+ getDatabaseColor ,
56 getDatabaseFriendlyName ,
67 getDatabaseIcon ,
78 getDatabaseVisual ,
@@ -36,6 +37,7 @@ export interface ResourceItemProps {
3637 href : string ;
3738 status ?: string ;
3839 lastUsed : number ;
40+ color ?: string ;
3941}
4042
4143export function getResourceItemPropsFromBase (
@@ -46,6 +48,7 @@ export function getResourceItemPropsFromBase(
4648 id : base . id ,
4749 type : base . sources [ 0 ] ?. type ?? "database" ,
4850 name : base . name ,
51+ color : getDatabaseColor ( base . sources [ 0 ] ?. type ?? "database" ) ,
4952 href : `/w/${ workspace . short_name } /${ base . short_name } ` ,
5053 lastUsed : base . last_analytics_event ?. created_at
5154 ? new Date ( base . last_analytics_event ?. created_at ) . getTime ( )
@@ -243,7 +246,7 @@ export function ResourceItemList({
243246 < ResourceCard
244247 key = { resource . id }
245248 className = "w-full"
246- color = "default"
249+ color = { resource . color ?? "default" }
247250 icon = { getDatabaseIcon ( resource . type ) }
248251 href = { resource . href }
249252 title = { resource . name }
Original file line number Diff line number Diff line change 44 PostgreIcon ,
55 RqliteIcon ,
66 SQLiteIcon ,
7+ TursoIcon ,
78} from "../icons/outerbase-icon" ;
89import { CloudflareIcon , StarbaseIcon , ValTownIcon } from "./icon" ;
910import {
@@ -41,8 +42,9 @@ export function getDatabaseIcon(type: string) {
4142 if ( type === "cloudflare" || type === "cloudflare-d1" ) return CloudflareIcon ;
4243 if ( type === "valtown" ) return ValTownIcon ;
4344 if ( type === "starbasedb" || type === "starbase" ) return StarbaseIcon ;
44- if ( type === "libsql" || type === "turso" ) return SQLiteIcon ;
45+ if ( type === "libsql" || type === "turso" ) return TursoIcon ;
4546 if ( type === "rqlite" ) return RqliteIcon ;
47+ if ( type === "sqlite" ) return SQLiteIcon ;
4648 if ( type === "board" ) return ChartBar ;
4749
4850 return Database ;
@@ -56,3 +58,10 @@ export function getDatabaseVisual(type: string) {
5658
5759 return GeneralVisual ;
5860}
61+
62+ export function getDatabaseColor ( type : string ) {
63+ if ( type === "cloudflare" || type === "cloudflare-d1" ) return "yellow" ;
64+ if ( type === "starbasedb" || type === "starbase" ) return "rainbow" ;
65+ if ( type === "libsql" || type === "turso" ) return "green" ;
66+ return "default" ;
67+ }
You can’t perform that action at this time.
0 commit comments