mirror of
https://github.com/supabase/supabase.git
synced 2026-10-09 19:35:06 +03:00
* Init custom content hook * Implement useCustomContent hook similarly to useIsFeatureEnabled, and implement extension of organization documents * Attempt to type things nicely * Add support for custom content example projects * Add support for custom content logs explorer default query * nit * Add support for custom content connect UI frameworks * Reset custom-content.json * Smol nit * set custom-content to null --------- Co-authored-by: Jordi Enric <jordi.err@gmail.com>
35 lines
954 B
TypeScript
35 lines
954 B
TypeScript
import { useTheme } from 'next-themes'
|
|
import Image from 'next/image'
|
|
|
|
import { BASE_PATH } from 'lib/constants'
|
|
|
|
interface ConnectionIconProps {
|
|
icon: string
|
|
}
|
|
|
|
export const ConnectionIcon = ({ icon }: ConnectionIconProps) => {
|
|
const { resolvedTheme } = useTheme()
|
|
|
|
const imageFolder = ['ionic-angular'].includes(icon) ? 'icons/frameworks' : 'libraries'
|
|
const imageExtension = imageFolder === 'icons/frameworks' ? '' : '-icon'
|
|
const iconImgSrc = icon.startsWith('http')
|
|
? icon
|
|
: `${BASE_PATH}/img/${imageFolder}/${icon.toLowerCase()}${
|
|
['expo', 'nextjs', 'prisma', 'drizzle', 'astro', 'remix'].includes(icon.toLowerCase())
|
|
? resolvedTheme?.includes('dark')
|
|
? '-dark'
|
|
: ''
|
|
: ''
|
|
}${imageExtension}.svg`
|
|
|
|
return (
|
|
<Image
|
|
className="transition-all group-hover:scale-110"
|
|
src={iconImgSrc}
|
|
alt={`${icon} logo`}
|
|
width={14}
|
|
height={14}
|
|
/>
|
|
)
|
|
}
|