'use client' import { useTranslation } from 'react-i18next' import useSWR from 'swr' import Link from 'next/link' import s from './index.module.css' import classNames from '@/utils/classnames' import { fetchAccountIntegrates } from '@/service/common' const titleClassName = ` mb-2 text-sm font-medium text-gray-900 ` export default function IntegrationsPage() { const { t } = useTranslation() const integrateMap = { google: { name: t('common.integrations.google'), description: t('common.integrations.googleAccount'), }, github: { name: t('common.integrations.github'), description: t('common.integrations.githubAccount'), }, } const { data } = useSWR({ url: '/account/integrates' }, fetchAccountIntegrates) const integrates = data?.data?.length ? data.data : [] return ( <>
{t('common.integrations.connected')}
{ integrates.map(integrate => (
{integrateMap[integrate.provider].name}
{integrateMap[integrate.provider].description}
{ !integrate.is_bound && ( {t('common.integrations.connect')} ) }
)) }
{/*
Add a service
{ services.map(service => (
{service.name}
{service.description}
)) }
*/} ) }