Full visual rework to a single locked design system (design.md, Lumen Night Foundry): dark violet canvas, molten-brass accent, Instrument Serif + Geist + JetBrains Mono, hairline cards, zero gradients and zero glassmorphism. - Landing: marquee hero with real vertical demo clip in an instrument bezel, meter strip, smart-crop before/after section, cloud-first copy (start free trial primary, self-host demoted to secondary), text density cut, SEO surfaces preserved (single h1, ids, FAQs, comparison table intact) - App: workbench restyle — sidebar with mono ordinals, unified header, settings/ai-agent/dashboard views on shared tokens; per-feature gradient identities retired - Shared UI: new Modal, SegmentedControl and StepIndicator replace 8+ duplicated modal shells and 2 wizard steppers - New pricing paywall page (#/pricing): demo proof strip, honest trust signals, billing FAQ - Routing: app logo links back to landing via #landing without resetting the skip-landing preference - Responsive: audited and fixed at 320/375/414/768px (no horizontal scroll, tables scroll in-container, single-line CTAs) - ScheduleWeekModal translated to English; ProcessingAnimation comment noise removed Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
28 lines
1.2 KiB
JavaScript
28 lines
1.2 KiB
JavaScript
import React from 'react';
|
|
import { Zap } from 'lucide-react';
|
|
import { useAuth } from '../contexts/AuthContext';
|
|
|
|
// Compact minutes-remaining pill for the header (managed users only).
|
|
export default function UsageMeter({ onClick }) {
|
|
const { isManaged, minutes } = useAuth();
|
|
if (!isManaged || !minutes) return null;
|
|
|
|
const remaining = Math.round((minutes.remaining || 0) * 10) / 10;
|
|
const allowance = (minutes.plan_allowance || 0) + (minutes.topup_remaining || 0) + (minutes.plan_used || 0);
|
|
const pct = allowance > 0 ? Math.max(4, Math.min(100, (remaining / allowance) * 100)) : 0;
|
|
const low = remaining <= (allowance * 0.2);
|
|
|
|
return (
|
|
<button
|
|
onClick={onClick}
|
|
title="Manage your plan"
|
|
className="flex items-center gap-2 px-3 py-1.5 rounded-full border border-rule2 bg-paper2 hover:bg-paper3 transition-colors"
|
|
>
|
|
<Zap size={14} className={low ? 'text-warn' : 'text-brass'} />
|
|
<span className={`readout ${low ? 'text-warn' : ''}`}>{remaining} min</span>
|
|
<span className="w-12 h-1.5 rounded-full bg-paper3 overflow-hidden hidden sm:inline-block">
|
|
<span className={`block h-full ${low ? 'bg-warn' : 'bg-brass'}`} style={{ width: `${pct}%` }} />
|
|
</span>
|
|
</button>
|
|
);
|
|
}
|