'use strict';

var dimension = require('../../../design/dimension.js');
var palette = require('../../../design/palette.js');
var Doc = require('../../util/Doc.js');

const PageLines = ({ color = palette.default.gray200, withHeaderDivider = true }) => async (doc) => {
    const horizontalLineY = dimension.Dimension.headerHeight;
    if (withHeaderDivider) {
        doc
            .strokeColor(color, 1)
            .moveTo(0, horizontalLineY)
            .lineTo(Doc.Doc.width, horizontalLineY)
            .stroke();
    }
    doc
        .strokeColor(color)
        .moveTo(Doc.Doc.width / 2, horizontalLineY)
        .lineTo(Doc.Doc.width / 2, Doc.Doc.height - dimension.Dimension.footerHeight)
        .stroke();
};

exports.PageLines = PageLines;
