Printers.tsx
2.48 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { useNavigate } from "react-router";
import { Card } from "../../components/ui/card";
import { ChevronLeft, Printer as PrinterIcon } from "lucide-react";
import { useLanguage } from "../../contexts/LanguageContext";
interface Printer {
id: string;
nameKey: string;
locationKey: string;
model: string;
}
const mockPrinters: Printer[] = [
{
id: "1",
nameKey: "printers.printer1.name",
locationKey: "printers.printer1.location",
model: "Zebra ZD620",
},
{
id: "2",
nameKey: "printers.printer2.name",
locationKey: "printers.printer2.location",
model: "Zebra ZD620",
},
{
id: "3",
nameKey: "printers.printer3.name",
locationKey: "printers.printer3.location",
model: "Zebra ZD420",
},
{
id: "4",
nameKey: "printers.printer4.name",
locationKey: "printers.printer4.location",
model: "Zebra ZD420",
},
];
export default function Printers() {
const navigate = useNavigate();
const { t } = useLanguage();
return (
<div className="min-h-screen bg-gray-50">
{/* Header */}
<div className="bg-white border-b border-gray-200 p-6">
<button
onClick={() => navigate("/more")}
className="flex items-center text-blue-600 mb-4"
>
<ChevronLeft className="w-5 h-5" />
<span className="text-base font-medium ml-1">{t("common.back")}</span>
</button>
<h1 className="text-2xl font-semibold text-gray-900 mb-1">{t("printers.title")}</h1>
<p className="text-base text-gray-600">
{mockPrinters.length} {t("printers.available")}
</p>
</div>
{/* Content */}
<div className="p-6">
<div className="space-y-3">
{mockPrinters.map((printer) => (
<Card key={printer.id} className="p-4">
<div className="flex items-start gap-4">
<div className="p-2 bg-blue-50 rounded-lg">
<PrinterIcon className="w-6 h-6 text-blue-600" />
</div>
<div className="flex-1">
<h3 className="text-base font-semibold text-gray-900 mb-1">
{t(printer.nameKey)}
</h3>
<p className="text-sm text-gray-500 mb-1">
{t(printer.locationKey)}
</p>
<p className="text-sm text-gray-400">{printer.model}</p>
</div>
</div>
</Card>
))}
</div>
</div>
</div>
);
}