refactoring
This commit is contained in:
@@ -3,13 +3,7 @@ class PdfCreator {
|
||||
static createPdf({ symptom, vaccine, heading, valueName }) {
|
||||
const documentDefinition = {
|
||||
content: [
|
||||
{
|
||||
text: heading,
|
||||
fontSize: 18,
|
||||
alignment: 'center',
|
||||
margin: [0, 0, 0, 20],
|
||||
bold: true
|
||||
},
|
||||
PdfCreator.#getPageHeading(heading),
|
||||
...PdfCreator.#getWorstDrugsSection(symptom, valueName),
|
||||
...PdfCreator.#getStrongestSymptoms(vaccine)
|
||||
]
|
||||
@@ -17,6 +11,16 @@ class PdfCreator {
|
||||
return pdfMake.createPdf(documentDefinition);
|
||||
}
|
||||
|
||||
static #getPageHeading(heading) {
|
||||
return {
|
||||
text: heading,
|
||||
fontSize: 18,
|
||||
alignment: 'center',
|
||||
margin: [0, 0, 0, 20],
|
||||
bold: true
|
||||
};
|
||||
}
|
||||
|
||||
static #getWorstDrugsSection({ selectElement, table }, valueName) {
|
||||
return [
|
||||
PdfCreator.#getHeading(`Worst ${valueName} for "${PdfCreator.#getSelection(selectElement)}"`),
|
||||
|
||||
Reference in New Issue
Block a user