railyard/apps/ritgram/web/components/AnalyticsChart.tsx
caelum0x f80b04ae0f feat(ritgram): move GitGram app into railyard as Ritgram, next to Rithub
Moved later/gitgram-ai/gitgram/ to apps/ritgram/ (fresh history; full history stays in caelum0x/gitgram).
AITimeMachine stays separate in later/gitgram-ai per the Rithub master plan.
Logs, pid files and env files are ignored; GPL-3.0 mobile/proximity noted in THIRD_PARTY_NOTICES.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 04:18:46 +03:00

26 lines
811 B
TypeScript

'use client';
export default function AnalyticsChart({ data }: { data: any[] }) {
const maxValue = Math.max(...data.map(d => d.views));
return (
<div className="bg-white dark:bg-gray-800 p-6 rounded-lg shadow">
<h3 className="font-bold mb-4">Views Over Time</h3>
<div className="flex items-end gap-2 h-48">
{data.map((day, i) => (
<div key={i} className="flex-1 flex flex-col items-center">
<div
className="w-full bg-blue-500 rounded-t"
style={{ height: `${(day.views / maxValue) * 100}%` }}
title={`${day.views} views`}
/>
<div className="text-xs text-gray-500 mt-2">
{new Date(day.date).getDate()}
</div>
</div>
))}
</div>
</div>
);
}