File size: 1,972 Bytes
e7427b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import { Database, Settings } from "lucide-react";
import { useIndexedDB } from "@/hooks/useIndexedDB";

export default function StorageStatus() {
  const { storageStats } = useIndexedDB();

  return (
    <Card className="bg-gradient-to-r from-emerald-50 to-blue-50 border-l-4 border-emerald">
      <CardContent className="pt-6">
        <div className="flex items-start justify-between">
          <div>
            <CardTitle className="text-lg font-poppins font-semibold text-deep-charcoal mb-2 flex items-center">
              <Database className="text-emerald mr-2" />
              Local Data Storage
            </CardTitle>
            <p className="text-warm-gray mb-4">
              All your calculations and data are stored locally on your device. No internet required.
            </p>
            <div className="flex flex-wrap gap-4 text-sm">
              <div className="flex items-center space-x-2">
                <span className="w-2 h-2 bg-emerald-500 rounded-full"></span>
                <span>{storageStats.calculations} Calculations Saved</span>
              </div>
              <div className="flex items-center space-x-2">
                <span className="w-2 h-2 bg-blue-500 rounded-full"></span>
                <span>{storageStats.reports} Reports Generated</span>
              </div>
              <div className="flex items-center space-x-2">
                <span className="w-2 h-2 bg-saffron rounded-full"></span>
                <span>{storageStats.size} MB Used</span>
              </div>
            </div>
          </div>
          <Button 
            variant="secondary"
            className="bg-emerald text-white hover:bg-emerald-600"
            size="sm"
          >
            <Settings className="w-4 h-4" />
          </Button>
        </div>
      </CardContent>
    </Card>
  );
}