refactor(web): remove typescript

This commit is contained in:
Ali BARIN
2024-02-27 15:23:23 +00:00
parent 636870a075
commit b3ae2d2748
337 changed files with 2067 additions and 4997 deletions

View File

@@ -1,29 +1,18 @@
import * as React from 'react';
import { useQuery } from '@apollo/client';
import type { IConnection } from 'types';
import { GET_APP_CONNECTIONS } from 'graphql/queries/get-app-connections';
import AppConnectionRow from 'components/AppConnectionRow';
import NoResultFound from 'components/NoResultFound';
import useFormatMessage from 'hooks/useFormatMessage';
import * as URLS from 'config/urls';
type AppConnectionsProps = {
appKey: string;
};
export default function AppConnections(
props: AppConnectionsProps
): React.ReactElement {
export default function AppConnections(props) {
const { appKey } = props;
const formatMessage = useFormatMessage();
const { data } = useQuery(GET_APP_CONNECTIONS, {
variables: { key: appKey },
});
const appConnections: IConnection[] = data?.getApp?.connections || [];
const appConnections = data?.getApp?.connections || [];
const hasConnections = appConnections?.length;
if (!hasConnections) {
return (
<NoResultFound
@@ -33,10 +22,9 @@ export default function AppConnections(
/>
);
}
return (
<>
{appConnections.map((appConnection: IConnection) => (
{appConnections.map((appConnection) => (
<AppConnectionRow key={appConnection.id} connection={appConnection} />
))}
</>