import React from 'react';
import { IntegrationName } from './types';
import integrations from './integrations';

export interface IntegrationProps {
  name: IntegrationName;
  className?: string;
  style?: {
    [key: string]: string;
  };
}

const Integration = ({ className, name, style = {} }: IntegrationProps) => {
  const Component = integrations[name] || integrations.other;

  return <Component className={className} style={{ flexShrink: 0, ...style }} />;
};

export default Integration;
