cleanup: use Period type instead of inline union in renderDashboard

This commit is contained in:
AgentSeal 2026-04-14 04:58:47 -07:00
parent bbaf71431d
commit efab93e78e
2 changed files with 2 additions and 2 deletions

View file

@ -44,7 +44,7 @@ function getDateRange(period: string): { range: DateRange; label: string } {
}
}
function toPeriod(s: string): 'today' | 'week' | 'month' | '30days' {
function toPeriod(s: string): 'today' | 'week' | '30days' | 'month' {
if (s === 'today') return 'today'
if (s === 'month') return 'month'
if (s === '30days') return '30days'

View file

@ -571,7 +571,7 @@ function StaticDashboard({ projects, period }: { projects: ProjectSummary[]; per
)
}
export async function renderDashboard(period: 'today' | 'week' | 'month' | '30days' = 'week', provider: string = 'all'): Promise<void> {
export async function renderDashboard(period: Period = 'week', provider: string = 'all'): Promise<void> {
await loadPricing()
const range = getDateRange(period)
const projects = await parseAllSessions(range, provider)