import { makeTable } from '@oclif/table';
import OutputManager from './outputManager.js';
export default class TablePrinter {
    columns;
    data;
    title;
    constructor(title, data, columns) {
        this.title = title;
        this.data = data;
        this.columns = columns;
    }
    print() {
        if (!this.data || this.data.length === 0) {
            OutputManager.info(`There are no ${this.title.toLowerCase()}.`);
            return;
        }
        const tableOptions = {
            borderStyle: 'all',
            columns: this.columns,
            data: this.data,
            headerOptions: {
                bold: true,
                color: 'white'
            },
            title: `${this.title}:`,
            verticalAlignment: 'center',
        };
        const table = makeTable(tableOptions);
        console.log(table);
    }
}
