import * as React from 'react'; import { useQuery } from '@apollo/client'; import { Link, Route, Navigate, Routes, useParams, useMatch, useNavigate } from 'react-router-dom'; import type { LinkProps } from 'react-router-dom'; import { useTheme } from '@mui/material/styles'; import useMediaQuery from '@mui/material/useMediaQuery'; import Box from '@mui/material/Box'; import Grid from '@mui/material/Grid'; import Tabs from '@mui/material/Tabs'; import Tab from '@mui/material/Tab'; import AddIcon from '@mui/icons-material/Add'; import useFormatMessage from 'hooks/useFormatMessage'; import { GET_APP } from 'graphql/queries/get-app'; import * as URLS from 'config/urls'; import ConditionalIconButton from 'components/ConditionalIconButton'; import AppConnections from 'components/AppConnections'; import AppFlows from 'components/AppFlows'; import AddAppConnection from 'components/AddAppConnection'; import AppIcon from 'components/AppIcon'; import Container from 'components/Container'; import PageTitle from 'components/PageTitle'; type ApplicationParams = { appKey: string; connectionId?: string; }; const ReconnectConnection = (props: any) => { const { application, onClose } = props; const { connectionId } = useParams() as ApplicationParams; return ( ); } export default function Application() { const theme = useTheme(); const matchSmallScreens = useMediaQuery(theme.breakpoints.down('md'), { noSsr: true }); const formatMessage = useFormatMessage(); const connectionsPathMatch = useMatch({ path: URLS.APP_CONNECTIONS_PATTERN, end: false }); const flowsPathMatch = useMatch({ path: URLS.APP_FLOWS_PATTERN, end: false }); const { appKey } = useParams() as ApplicationParams; const navigate = useNavigate(); const { data } = useQuery(GET_APP, { variables: { key: appKey } }); const goToApplicationPage = () => navigate('connections'); const app = data?.getApp || {}; const NewConnectionLink = React.useMemo( () => React.forwardRef>(function InlineLink( linkProps, ref, ) { return ; }), [appKey], ); const NewFlowLink = React.useMemo( () => React.forwardRef>(function InlineLink( linkProps, ref, ) { return ; }), [appKey], ); return ( <> {app.name} } > {formatMessage('app.createFlow')} } /> } > {formatMessage('app.addConnection')} } /> } /> } /> } /> } /> } /> ); };