44// isGuestDashboardKey, isSharedDashboardKey,
55// } from '~/utils/dashboard/key'
66import type { HashTab } from ' ~/components/bc/tab/BcTabList.vue'
7+ import type { ValidatorDashboard } from ' ~/types/api/dashboard'
78import type { SlotVizEpoch } from ' ~/types/api/slot_viz'
89import type { VDBOverviewData } from ' ~/types/api/validator_dashboard'
910// import type { TableQueryParams } from '~/types/datatable'
@@ -207,6 +208,7 @@ const tabs: HashTab[] = [
207208defineProps <{
208209 overview: null | VDBOverviewData ,
209210 slotVizEpochs: null | SlotVizEpoch [],
211+ validatorDashboards: null | ValidatorDashboard [],
210212}>()
211213const visible = ref (false )
212214const onShowCreation = () => {
@@ -227,40 +229,42 @@ const emit = defineEmits<{
227229// const onTabChange = (value: string) => {
228230// tab.value = value
229231// }
232+ const { key } = useDashboard ()
230233 </script >
231234
232235<template >
233236 <!-- <NuxtLayout v-if="!dashboardKey && !dashboards?.validator_dashboards?.length">
234- <DashboardCreationController
235- class="panel-controller"
236- :display-mode="'panel'"
237- :initially-visible="true"
238- />
239- </NuxtLayout> -->
237+ <DashboardCreationController
238+ class="panel-controller"
239+ :display-mode="'panel'"
240+ :initially-visible="true"
241+ />
242+ </NuxtLayout> -->
240243 <NuxtLayout name =" default" >
241244 <BcDialog v-model =" visible" >
242- <DashboardCreationController
245+ <LazyDashboardCreationController
243246 v-if =" visible"
244247 ref =" dashboardCreationControllerModal"
245248 class =" modal-controller"
246249 />
247250 </BcDialog >
248251 <template #banner >
249- <BcNotificationBanner
252+ <LazyBcNotificationBanner
250253 v-if =" overview?.is_above_effective_balance_limit"
251254 :title =" $t('dashboard.subsciprion_limit_reached_title')"
252255 >
253- <BcTranslation
256+ <LazyBcTranslation
257+ v-if =" overview?.is_above_effective_balance_limit"
254258 keypath =" dashboard.subsciprion_limit_reached.template"
255259 linkpath =" dashboard.subsciprion_limit_reached._link"
256260 to =" /pricing"
257261 />
258- </BcNotificationBanner >
262+ </LazyBcNotificationBanner >
259263 </template >
260264 <DashboardHeader @show-creation =" onShowCreation()" />
261265 <DashboardControls
262266 v-model:is-visible-management-modal =" isVisibleManagementModal"
263- :dashboard-title = " overview?.name "
267+ :validator-dashboards
264268 @change-validators =" emit('change-validators', $event)"
265269 />
266270 <DashboardValidatorOverview
@@ -278,54 +282,54 @@ const emit = defineEmits<{
278282 class =" dashboard-tab-view"
279283 panels-class =" dashboard-tab-panels"
280284 >
281- <template #tab-panel-summary >
282- <DashboardTableSummary
283- @add-validator = " onAddValidator "
285+ <template #tab-panel-summary = " { isActive } " >
286+ <LazyDashboardTableSummary
287+ v-if = " key && isActive "
284288 />
285289 </template >
286- <template #tab-panel-rewards >
287- <DashboardTableRewards
288- @add-validator = " onAddValidator "
290+ <template #tab-panel-rewards = " { isActive } " >
291+ <LazyDashboardTableRewards
292+ v-if = " key && isActive "
289293 />
290294 </template >
291- <template #tab-panel-blocks >
292- <DashboardTableBlocks
293- @add-validator = " onAddValidator "
295+ <template #tab-panel-blocks = " { isActive } " >
296+ <LazyDashboardTableBlocks
297+ v-if = " key && isActive "
294298 />
295299 </template >
296- <template #tab-panel-deposits >
297- <DashboardTableElDeposits
298- @add-validator =" onAddValidator"
299- />
300- <BcIcon
301- name =" arrow-down"
302- class =" down_icon"
303- />
304- <DashboardTableClDeposits
305- @add-validator =" onAddValidator"
306- />
300+ <template #tab-panel-deposits =" { isActive } " >
301+ <div v-if =" key && isActive" >
302+ <LazyDashboardTableElDeposits />
303+ <LazyBcIcon
304+ name =" arrow-down"
305+ class =" down_icon"
306+ />
307+ <LazyDashboardTableClDeposits />
308+ </div >
307309 </template >
308- <template #tab-panel-withdrawals >
309- <DashboardTableElWithdrawals
310- @add-validator =" onAddValidator"
311- />
312- <BcIcon
313- name =" arrow-down"
314- class =" down_icon"
315- />
316- <DashboardTableClWithdrawals
317- @add-validator =" onAddValidator"
318- />
310+ <template #tab-panel-withdrawals =" { isActive } " >
311+ <div v-if =" key && isActive" >
312+ <LazyDashboardTableElWithdrawals />
313+ <LazyBcIcon
314+ name =" arrow-down"
315+ class =" down_icon"
316+ />
317+ <LazyDashboardTableClWithdrawals />
318+ </div >
319319 </template >
320- <template #tab-panel-consolidations >
321- <DashboardTableElConsolidations
322- @add-validator =" onAddValidator"
323- />
324- <BcIcon
325- name =" arrow-down"
326- class =" down_icon"
327- />
328- <DashboardTableClConsolidations
320+ <template #tab-panel-consolidations =" { isActive } " >
321+ <div v-if =" key && isActive" >
322+ <LazyDashboardTableElConsolidations />
323+ <LazyBcIcon
324+ name =" arrow-down"
325+ class =" down_icon"
326+ />
327+ <LazyDashboardTableClConsolidations />
328+ </div >
329+ </template >
330+ <template #empty >
331+ <LazyDashboardTableAddValidator
332+ v-if =" !key"
329333 @add-validator =" onAddValidator"
330334 />
331335 </template >
0 commit comments