/**
 * Copyright (c) 2025 Huawei Technologies Co., Ltd.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

import mustache from 'mustache';

const TEMPLATE = `
{
  "string": [
    {
      "name": "module_desc",
      "value": "{{description}}"
    },
    {
      "name": "EntryAbility_desc",
      "value": "{{description}}"
    },
    {
      "name": "EntryAbility_label",
      "value": "{{name}}"
    }
  ]
}
`;

export class EntryStringVarTemplate {
  constructor(private name: string, private description: string) {}

  build(): string {
    return mustache.render(TEMPLATE.trimStart(), {
      name: this.name,
      description: this.description,
    });
  }
}