11import { Popover , Transition } from '@headlessui/react'
22import { useQueryClient } from '@tanstack/react-query'
33import clsx from 'clsx'
4- import { lazy , Fragment , type MouseEvent } from 'react'
4+ import { Fragment , type MouseEvent } from 'react'
55import { apiCancelPlanApply } from '~/api'
66import { useStoreContext } from '~/context/context'
77import {
@@ -14,10 +14,7 @@ import {
1414} from '~/context/plan'
1515import { EnumSize , EnumVariant } from '~/types/enum'
1616import { Button } from '../button/Button'
17-
18- const TasksProgress = lazy (
19- async ( ) => await import ( '../tasksProgress/TasksProgress' ) ,
20- )
17+ import TasksOverview from '../tasksOverview/TasksOverview'
2118
2219export default function ActivePlan ( {
2320 plan,
@@ -67,15 +64,33 @@ export default function ActivePlan({
6764 >
6865 < Popover . Panel className = "absolute right-1 z-10 mt-8 transform" >
6966 < div className = "overflow-hidden rounded-lg bg-theme shadow-lg ring-1 ring-black ring-opacity-5" >
70- < TasksProgress
71- environment = { environment }
72- tasks = { plan . tasks }
73- updated_at = { plan . updated_at }
74- headline = "Most Recent Plan"
75- showBatches = { plan . type !== EnumPlanApplyType . Virtual }
76- showVirtualUpdate = { plan . type === EnumPlanApplyType . Virtual }
77- planState = { planState }
78- />
67+ < TasksOverview tasks = { plan . tasks } >
68+ { ( { total, completed, models } ) => (
69+ < >
70+ < TasksOverview . Summary
71+ environment = { environment . name }
72+ planState = { planState }
73+ headline = "Most Recent Plan"
74+ completed = { completed }
75+ total = { total }
76+ updateType = {
77+ plan . type === EnumPlanApplyType . Virtual
78+ ? 'Virtual'
79+ : 'Backfill'
80+ }
81+ updatedAt = { plan . updated_at }
82+ />
83+ < TasksOverview . Details
84+ models = { models }
85+ showBatches = { plan . type !== EnumPlanApplyType . Virtual }
86+ showVirtualUpdate = {
87+ plan . type === EnumPlanApplyType . Virtual
88+ }
89+ showProgress = { true }
90+ />
91+ </ >
92+ ) }
93+ </ TasksOverview >
7994 < div className = "my-4 px-4" >
8095 { planState === EnumPlanState . Applying && (
8196 < Button
0 commit comments