mirror of
https://github.com/etiennecollin/unifi-voucher-manager.git
synced 2025-10-23 08:12:15 +00:00
style: commenting and changed component names
This commit is contained in:
@@ -16,7 +16,8 @@ import { formatCode } from "@/utils/format";
|
|||||||
|
|
||||||
export type PrintMode = "list" | "grid";
|
export type PrintMode = "list" | "grid";
|
||||||
|
|
||||||
function VoucherBlock({ voucher }: { voucher: Voucher }) {
|
// This component represents a single voucher card to be printed
|
||||||
|
function VoucherPrintCard({ voucher }: { voucher: Voucher }) {
|
||||||
const { wifiConfig, wifiString } = useGlobal();
|
const { wifiConfig, wifiString } = useGlobal();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -102,6 +103,7 @@ function VoucherBlock({ voucher }: { voucher: Voucher }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This component handles fetching and displaying vouchers based on URL params
|
||||||
function Vouchers() {
|
function Vouchers() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
@@ -144,12 +146,13 @@ function Vouchers() {
|
|||||||
) : (
|
) : (
|
||||||
<div className={mode === "grid" ? "print-grid" : "print-list"}>
|
<div className={mode === "grid" ? "print-grid" : "print-list"}>
|
||||||
{vouchers.map((v) => (
|
{vouchers.map((v) => (
|
||||||
<VoucherBlock key={v.id} voucher={v} />
|
<VoucherPrintCard key={v.id} voucher={v} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This sets up the print page itself
|
||||||
export default function PrintPage() {
|
export default function PrintPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user