mirror of
https://github.com/supabase/supabase.git
synced 2026-07-05 20:14:30 +08:00
* add new page * moar * moar * added icons * improve icons * moved connect dialog to main header * update text * smaller screen support * moar * add python and sqlalchemyString * moar * add IPv4 warning * moar * Delete pooler-icons-v2.tsx * tidy * Delete DatabaseSettings.tsx * tidy * tidy * moar. Session pooler is de-prioritized * Update DatabaseConnectionString.tsx * type issue * moar * Update DatabaseConnectionString.tsx * Spelling * Clean up LayoutHeader * Clean up ConnectionPanel * Clean up ConnectionParameters * Last batch of clean up * Fix loading state padding * Shift old Connect files to new Connect folder outside of Home * Final clean up * Smol fix * FIX * Fix button link * Fixes * Lint --------- Co-authored-by: Terry Sutton <saltcod@gmail.com> Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
32 lines
914 B
TypeScript
32 lines
914 B
TypeScript
import { useTheme } from 'next-themes'
|
|
import Image from 'next/image'
|
|
|
|
import { BASE_PATH } from 'lib/constants'
|
|
|
|
interface ConnectionIconProps {
|
|
connection: any
|
|
}
|
|
|
|
export const ConnectionIcon = ({ connection }: ConnectionIconProps) => {
|
|
const { resolvedTheme } = useTheme()
|
|
|
|
const imageFolder = ['ionic-angular'].includes(connection) ? 'icons/frameworks' : 'libraries'
|
|
const imageExtension = imageFolder === 'icons/frameworks' ? '' : '-icon'
|
|
|
|
return (
|
|
<Image
|
|
className="transition-all group-hover:scale-110"
|
|
src={`${BASE_PATH}/img/${imageFolder}/${connection.toLowerCase()}${
|
|
['expo', 'nextjs', 'prisma', 'drizzle', 'astro', 'remix'].includes(connection.toLowerCase())
|
|
? resolvedTheme?.includes('dark')
|
|
? '-dark'
|
|
: ''
|
|
: ''
|
|
}${imageExtension}.svg`}
|
|
alt={`${connection} logo`}
|
|
width={14}
|
|
height={14}
|
|
/>
|
|
)
|
|
}
|