import { useParams } from 'common' import { PropsWithChildren } from 'react' import { cn } from 'ui' import { useAvailableIntegrations } from '../../Landing/useAvailableIntegrations' import { FilesViewer } from './FilesViewer' import { MarkdownContent } from './MarkdownContent' import { InlineLinkClassName } from '@/components/ui/InlineLink' const getSiteUrlLabel = (url: string | undefined | null) => { if (!url) return undefined try { return new URL(url).origin } catch (error) { return undefined } } const isGithubHost = (url: string | undefined | null) => { if (!url) return false try { const hostname = new URL(url).hostname.toLowerCase() return hostname === 'github.com' || hostname.endsWith('.github.com') } catch (error) { return false } } /** * [Joshen] This will serve as the overview tab for remotely fetched integrations */ export const IntegrationOverviewTabV2 = ({ children }: PropsWithChildren) => { const { id } = useParams() const { data: allIntegrations } = useAvailableIntegrations() const integration = allIntegrations.find((i) => i.id === id) if (!integration) { return
Details
Type
{type === 'oauth' ? 'OAuth' : type.replaceAll('_', ' ')}
Built by
{integration.author.name || 'Unknown Author'}
Docs
{docsUrlLabel}Website
{siteUrlLabel}