From f2b217c99933f56b3bd7bdc487b4d2ee7b219553 Mon Sep 17 00:00:00 2001 From: autocommit Date: Sun, 12 Apr 2026 22:38:56 -0700 Subject: [PATCH] =?UTF-8?q?refactor(frontend-provider):=20=E2=99=BB?= =?UTF-8?q?=EF=B8=8F=20Remove=20higherIsBetter=20prop=20and=20consolidate?= =?UTF-8?q?=20trend=20logic=20across=20ContentPerformancePage,=20Dashboard?= =?UTF-8?q?Page,=20and=20EarningsPage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- .../frontend-provider/src/components/KPICard.tsx | 3 +-- .../src/pages/ContentPerformancePage.tsx | 9 --------- .../frontend-provider/src/pages/DashboardPage.tsx | 4 ++-- .../frontend-provider/src/pages/EarningsPage.tsx | 3 +-- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/features/platform-analytics/frontend-provider/src/components/KPICard.tsx b/features/platform-analytics/frontend-provider/src/components/KPICard.tsx index 0426fb8cc..df01f1fe5 100644 --- a/features/platform-analytics/frontend-provider/src/components/KPICard.tsx +++ b/features/platform-analytics/frontend-provider/src/components/KPICard.tsx @@ -68,10 +68,9 @@ export interface KPICardProps { label: string; value: ReactNode; trend?: number; - higherIsBetter?: boolean; } -export function KPICard({ label, value, trend, higherIsBetter = true }: KPICardProps) { +export function KPICard({ label, value, trend }: KPICardProps) { const getTrendDirection = (): 'up' | 'down' | 'neutral' => { if (trend === undefined || trend === 0) return 'neutral'; return trend > 0 ? 'up' : 'down'; diff --git a/features/platform-analytics/frontend-provider/src/pages/ContentPerformancePage.tsx b/features/platform-analytics/frontend-provider/src/pages/ContentPerformancePage.tsx index ddc679b94..3fe5d1720 100644 --- a/features/platform-analytics/frontend-provider/src/pages/ContentPerformancePage.tsx +++ b/features/platform-analytics/frontend-provider/src/pages/ContentPerformancePage.tsx @@ -9,7 +9,6 @@ import { useState } from 'react'; import styled from '@lilith/ui-styled-components'; -import { useProviderProfile } from '../hooks/useProviderProfile'; import { type DateRangePreset } from '../utils/dateRange'; const Container = styled.div` @@ -70,12 +69,6 @@ const CardTitle = styled.h2` margin-bottom: ${({ theme }) => theme.spacing.lg}; `; -const EmptyState = styled.div` - text-align: center; - padding: ${({ theme }) => theme.spacing.xxl}; - color: ${({ theme }) => theme.colors.text.secondary}; -`; - const InfoBox = styled.div` background: ${({ theme }) => theme.colors.primary.main}15; border: 1px solid ${({ theme }) => theme.colors.primary.main}30; @@ -89,8 +82,6 @@ const InfoBox = styled.div` const ContentPerformancePage = () => { const [dateRangePreset, setDateRangePreset] = useState('30d'); - const { profileId } = useProviderProfile(); - return (
diff --git a/features/platform-analytics/frontend-provider/src/pages/DashboardPage.tsx b/features/platform-analytics/frontend-provider/src/pages/DashboardPage.tsx index 942d8b941..8ff281532 100644 --- a/features/platform-analytics/frontend-provider/src/pages/DashboardPage.tsx +++ b/features/platform-analytics/frontend-provider/src/pages/DashboardPage.tsx @@ -85,13 +85,13 @@ const DashboardPage = () => { const { profileId, isLoading: profileLoading } = useProviderProfile(); const { data: overview, isLoading: overviewLoading } = useProfileOverview(profileId, dateRangePreset); - const { data: earnings, isLoading: earningsLoading } = useEarningsSummary(profileId, dateRangePreset); + const { data: earnings } = useEarningsSummary(profileId, dateRangePreset); const { data: earningsHistory, isLoading: earningsHistoryLoading } = useEarningsHistory( profileId, '7d', 'day', ); - const { data: clients, isLoading: clientsLoading } = useClientSummary(profileId, dateRangePreset); + const { data: clients } = useClientSummary(profileId, dateRangePreset); if (profileLoading || overviewLoading) { return ( diff --git a/features/platform-analytics/frontend-provider/src/pages/EarningsPage.tsx b/features/platform-analytics/frontend-provider/src/pages/EarningsPage.tsx index 6c0b95019..47205beb7 100644 --- a/features/platform-analytics/frontend-provider/src/pages/EarningsPage.tsx +++ b/features/platform-analytics/frontend-provider/src/pages/EarningsPage.tsx @@ -10,7 +10,6 @@ import { useState } from 'react'; import styled from '@lilith/ui-styled-components'; -import { DollarSignIcon, TrendingUpIcon, ClockIcon, CheckCircleIcon } from '@lilith/ui-icons'; import { KPICard } from '../components/KPICard'; import { EarningsChart } from '../components/EarningsChart'; @@ -22,7 +21,7 @@ import { usePayoutHistory, } from '../hooks/useProviderEarnings'; import { type DateRangePreset } from '../utils/dateRange'; -import { formatCurrency, formatNumber } from '../utils/formatters'; +import { formatCurrency } from '../utils/formatters'; const Container = styled.div` max-width: 1400px;