{!isStandalone && (
{t('back_to_library')}
)}
{/* Standalone pages (Momsdeklaration) render their own PageHeader so
the primary action can live on the title row; the view receives the
title via pageTitle instead. */}
{!isStandalone && (
{
setSelectedPeriod(id || '')
setSelectedPeriodBounds(
period ? { start: period.period_start, end: period.period_end } : null,
)
setDateRange({})
}}
includeAllOption={false}
hideFuturePeriods
onReady={() => setIsReady(true)}
initialPeriods={initialPeriods}
initialCompanyId={initialCompanyId}
/>
}
/>
)}
{DATE_RANGE_SLUGS.has(slug) && selectedPeriodBounds && (
)}
{DIMENSION_FILTER_SLUGS.has(slug) && selectedPeriod && (
)}
{!isReady && !isPeriodless ? (
) : isPeriodless || selectedPeriod ? (
) : (
)}
)
}
function FocusedView({
slug,
reportName,
periodId,
periodBounds,
dateRange,
dimensionFilter,
accountFilter,
isEnskildFirma,
isAktiebolag,
onNavigateToAccount,
}: {
slug: string
reportName: string
periodId: string
periodBounds: { start: string; end: string } | null
dateRange: DateRangeValue
dimensionFilter: DimensionFilterValue | null
accountFilter: string | null
isEnskildFirma: boolean
isAktiebolag: boolean
onNavigateToAccount: (account: string) => void
}) {
switch (slug) {
case 'resultatrapport':
return