import PinEntity from "../entity/PinEntity"
import Template from "./Template"
/**
* @typedef {import("../entity/ObjectEntity").default} ObjectEntity
*/
export default class NodeTemplate extends Template {
/**
* Computes the html content of the target element.
* @param {ObjectEntity} entity Entity representing the element
* @returns The computed html
*/
header(entity) {
return `
`
}
/**
* Computes the html content of the target element.
* @param {ObjectEntity} entity Entity representing the element
* @returns The computed html
*/
body(entity) {
/** @type {PinEntity[]} */
let inputs = entity.CustomProperties.filter(v => v instanceof PinEntity)
let outputs = inputs.filter(v => v.isOutput())
inputs = inputs.filter(v => !v.isOutput())
return `
${outputs.map((output, index) => `
${output.getPinDisplayName()}
`).join('') ?? ''}
`
}
/**
* Computes the html content of the target element.
* @param {ObjectEntity} entity Entity representing the element
* @returns The computed html
*/
render(entity) {
return `