Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

865 B
Raw Blame
import { AnalyticsBucket, BigQuery, ClickHouse, Database } from 'icons'
import { SnowflakeIcon } from 'lucide-react'
import type { ComponentType, SVGProps } from 'react'

import type { DestinationType } from './DestinationPanel/DestinationPanel.types'

type DestinationIconComponent = ComponentType<SVGProps<SVGSVGElement> & { size?: string | number }>

const destinationIconByType: Record<DestinationType, DestinationIconComponent> = {
  BigQuery,
  'Analytics Bucket': AnalyticsBucket,
  DuckLake: Database,
  Snowflake: SnowflakeIcon,
  ClickHouse,
}

interface DestinationIconProps extends Omit<SVGProps<SVGSVGElement>, 'strokeWidth'> {
  type: DestinationType
  size?: string | number
}

export const DestinationIcon = ({ type, ...props }: DestinationIconProps) => {
  const Icon = destinationIconByType[type]

  return <Icon {...props} strokeWidth={1.5} />
}