Initial commit - WhyRating Engine (Google Reviews Scraper)
This commit is contained in:
@@ -29,14 +29,14 @@ const ICONS: Record<string, React.ComponentType<{ className?: string }>> = {
|
||||
activity: Activity,
|
||||
};
|
||||
|
||||
// Color mapping
|
||||
// Color mapping (light mode optimized for bg-gray-50 background)
|
||||
const COLORS: Record<string, string> = {
|
||||
blue: 'text-blue-600 bg-blue-100 dark:text-blue-400 dark:bg-blue-900/30',
|
||||
green: 'text-green-600 bg-green-100 dark:text-green-400 dark:bg-green-900/30',
|
||||
red: 'text-red-600 bg-red-100 dark:text-red-400 dark:bg-red-900/30',
|
||||
yellow: 'text-yellow-600 bg-yellow-100 dark:text-yellow-400 dark:bg-yellow-900/30',
|
||||
purple: 'text-purple-600 bg-purple-100 dark:text-purple-400 dark:bg-purple-900/30',
|
||||
gray: 'text-gray-600 bg-gray-100 dark:text-gray-400 dark:bg-gray-700',
|
||||
blue: 'text-blue-700 bg-blue-100',
|
||||
green: 'text-green-700 bg-green-100',
|
||||
red: 'text-red-700 bg-red-100',
|
||||
yellow: 'text-yellow-700 bg-yellow-100',
|
||||
purple: 'text-purple-700 bg-purple-100',
|
||||
gray: 'text-gray-700 bg-gray-100',
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -70,7 +70,7 @@ function formatValue(value: number | string, format?: string): string {
|
||||
* Stat card widget for displaying KPIs.
|
||||
*/
|
||||
export function StatCard({ config, data, loading, error, onRefresh }: StatCardProps) {
|
||||
const widgetConfig = config.config as StatCardConfig;
|
||||
const widgetConfig = config.config as unknown as StatCardConfig;
|
||||
const Icon = widgetConfig.icon ? ICONS[widgetConfig.icon] : Activity;
|
||||
const colorClass = widgetConfig.color ? COLORS[widgetConfig.color] : COLORS.gray;
|
||||
|
||||
@@ -82,7 +82,7 @@ export function StatCard({ config, data, loading, error, onRefresh }: StatCardPr
|
||||
<WidgetWrapper config={config} loading={loading} error={error} onRefresh={onRefresh}>
|
||||
<div className="flex items-center justify-between h-full">
|
||||
<div className="flex-1">
|
||||
<p className="text-3xl font-bold text-gray-900 dark:text-gray-100">
|
||||
<p className="text-3xl font-bold text-gray-900">
|
||||
{formatValue(value, widgetConfig.format)}
|
||||
</p>
|
||||
{trend !== undefined && (
|
||||
|
||||
Reference in New Issue
Block a user