import { serverFetchJson } from '@/app/utils/fetchUtil';
import { BASE_API_URL } from '@/config/api';
import { cache } from "react";
import "server-only";

export interface PrinterCombo {
    id: number;
    value: number;
    label?: string;
    code?: string;
    name?: string;
    description?: string;
    ip?: string;
    port?: number;
}

export const fetchPrinterCombo = cache(async () => {
    return serverFetchJson<PrinterCombo[]>(`${BASE_API_URL}/printers/combo`, {
        next: { tags: ["qcItems"] },
    })
})