feat: introduce dynamic flow data

This commit is contained in:
Ali BARIN
2021-12-09 23:47:13 +01:00
parent 2e1523b40f
commit ec53d0ae66
5 changed files with 26 additions and 15 deletions

View File

@@ -1,14 +1,21 @@
import { useQuery } from '@apollo/client';
import { GET_FLOWS } from 'graphql/queries/get-flows';
import AppFlowRow from 'components/AppFlowRow';
import type { Flow } from 'types/flow';
type AppFlowsProps = {
appKey: String;
}
export default function AppFlows(props: AppFlowsProps) {
const { data } = useQuery(GET_FLOWS);
const appFlows: Flow[] = data?.getFlows || [];
return (
<>
{Array.from(new Array(3)).map((item: any, index: number) => (
<AppFlowRow key={index} flow={item} />
{appFlows.map((appFlow: Flow) => (
<AppFlowRow key={appFlow.id} flow={appFlow} />
))}
</>
)