feat(stat-card-component): StatCard für Dashboards [tsc:fail]
This commit is contained in:
parent
a984b9b409
commit
153151a9f1
@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"completed_features": [],
|
"completed_features": [],
|
||||||
"current_feature": "page-header-component",
|
"current_feature": "stat-card-component",
|
||||||
"started_at": "2026-05-23T10:23:26.274445"
|
"started_at": "2026-05-23T10:23:26.274445",
|
||||||
|
"attempted_features": [
|
||||||
|
"page-header-component"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
@ -4290,3 +4290,21 @@ src/index.ts(27,25): error TS2769: No overload matches this call.
|
|||||||
Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
|
Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
|
||||||
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
|
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
|
||||||
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,
|
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,
|
||||||
|
- `10:23:37` **INFO** Committed feature page-header-component
|
||||||
|
- `10:23:38` **INFO** Pushed: rc=0
|
||||||
|
|
||||||
|
## Phase-3 Feature: stat-card-component (2026-05-23 10:23:38)
|
||||||
|
|
||||||
|
- `10:23:38` **INFO** Description: StatCard für Dashboards
|
||||||
|
- `10:23:38` **INFO** Generating apps/web/src/components/StatCard.tsx (StatCard-Component. Props: label, value (string|number), icon?, change…)
|
||||||
|
- `10:23:49` **INFO** wrote 1265 chars in 11.4s (attempt 1)
|
||||||
|
- `10:23:49` **INFO** Running tsc --noEmit on api…
|
||||||
|
- `10:23:51` **WARN** tsc errors:
|
||||||
|
src/db/schema.ts(37,14): error TS7022: 'customers' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
|
||||||
|
src/db/schema.ts(45,59): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
|
||||||
|
src/db/schema.ts(49,14): error TS7022: 'projects' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
|
||||||
|
src/db/schema.ts(53,56): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
|
||||||
|
src/index.ts(27,25): error TS2769: No overload matches this call.
|
||||||
|
Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
|
||||||
|
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
|
||||||
|
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,
|
||||||
|
|||||||
40
apps/web/src/components/StatCard.tsx
Normal file
40
apps/web/src/components/StatCard.tsx
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import type { ReactNode } from 'react';
|
||||||
|
|
||||||
|
interface StatCardProps {
|
||||||
|
label: string;
|
||||||
|
value: string | number;
|
||||||
|
icon?: ReactNode;
|
||||||
|
change?: number;
|
||||||
|
unit?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function StatCard({ label, value, icon, change, unit }: StatCardProps) {
|
||||||
|
const isPositive = change && change > 0;
|
||||||
|
const isNegative = change && change < 0;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="p-6 bg-white border border-slate-200 rounded-xl shadow-sm">
|
||||||
|
<div className="flex items-start justify-between">
|
||||||
|
<div className="p-2 bg-slate-50 rounded-lg text-slate-500">
|
||||||
|
{icon}
|
||||||
|
</div>
|
||||||
|
{change !== undefined && (
|
||||||
|
<div className={`flex items-center text-xs font-medium ${isPositive ? 'text-emerald-600' : 'text-rose-600'}`}>
|
||||||
|
{isPositive ? '↑' : '↓'} {Math.abs(change)}%
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="mt-4">
|
||||||
|
<p className="text-sm font-medium text-slate-500">{label}</p>
|
||||||
|
<div className="flex items-baseline gap-1 mt-1">
|
||||||
|
<h3 className="text-2xl font-bold text-slate-900">
|
||||||
|
{value}
|
||||||
|
</h3>
|
||||||
|
{unit && <span className="text-sm font-medium text-slate-500">{unit}</span>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user