refactor: simplify GoalStats component by removing unused props and updating SiteDashboardPage accordingly
This commit is contained in:
@@ -378,7 +378,7 @@ export default function SiteDashboardPage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mb-8">
|
<div className="mb-8">
|
||||||
<GoalStats goalCounts={goalCounts} siteId={siteId} dateRange={dateRange} />
|
<GoalStats goalCounts={goalCounts} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<DatePicker
|
<DatePicker
|
||||||
|
|||||||
@@ -7,13 +7,11 @@ import type { GoalCountStat } from '@/lib/api/stats'
|
|||||||
|
|
||||||
interface GoalStatsProps {
|
interface GoalStatsProps {
|
||||||
goalCounts: GoalCountStat[]
|
goalCounts: GoalCountStat[]
|
||||||
siteId: string
|
|
||||||
dateRange: { start: string; end: string }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const LIMIT = 10
|
const LIMIT = 10
|
||||||
|
|
||||||
export default function GoalStats({ goalCounts, siteId, dateRange }: GoalStatsProps) {
|
export default function GoalStats({ goalCounts }: GoalStatsProps) {
|
||||||
const list = (goalCounts || []).slice(0, LIMIT)
|
const list = (goalCounts || []).slice(0, LIMIT)
|
||||||
const hasData = list.length > 0
|
const hasData = list.length > 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user