Files
supabase/apps/studio/components/interfaces/Organization/Usage/SizeAndCounts.tsx
Joshen Lim 7f5865872a Enforce noUnusedLocals and noUnusedParameters in tsconfig.json + fix all related issues (#45264)
## Context

Enforce `noUnusedLocals` and `noUnusedParameters` in tsconfig.json + fix
all related issues
2026-04-27 17:42:34 +08:00

64 lines
1.7 KiB
TypeScript

import { dailyUsageToDataPoints } from './Usage.utils'
import UsageSection from './UsageSection/UsageSection'
import { DataPoint } from '@/data/analytics/constants'
import { PricingMetric, type OrgDailyUsageResponse } from '@/data/analytics/org-daily-stats-query'
import type { OrgSubscription } from '@/data/subscriptions/types'
export interface SizeAndCountsProps {
orgSlug: string
projectRef?: string | null
subscription: OrgSubscription | undefined
currentBillingCycleSelected: boolean
orgDailyStats: OrgDailyUsageResponse | undefined
isLoadingOrgDailyStats: boolean
startDate: string | undefined
endDate: string | undefined
}
const SizeAndCounts = ({
orgSlug,
projectRef,
subscription,
currentBillingCycleSelected,
orgDailyStats,
isLoadingOrgDailyStats,
startDate,
endDate,
}: SizeAndCountsProps) => {
const chartMeta: {
[key: string]: { data: DataPoint[]; margin: number; isLoading: boolean }
} = {
[PricingMetric.STORAGE_SIZE]: {
isLoading: isLoadingOrgDailyStats,
margin: 14,
data: dailyUsageToDataPoints(
orgDailyStats,
(metric) => metric === PricingMetric.STORAGE_SIZE
),
},
[PricingMetric.DATABASE_SIZE]: {
isLoading: isLoadingOrgDailyStats,
margin: 14,
data: dailyUsageToDataPoints(
orgDailyStats,
(metric) => metric === PricingMetric.DATABASE_SIZE
),
},
}
return (
<UsageSection
orgSlug={orgSlug}
projectRef={projectRef}
categoryKey="sizeCount"
chartMeta={chartMeta}
subscription={subscription}
currentBillingCycleSelected={currentBillingCycleSelected}
startDate={startDate}
endDate={endDate}
/>
)
}
export default SizeAndCounts