diff --git a/src/block.ts b/src/block.ts index 6cdccec..78ee88b 100644 --- a/src/block.ts +++ b/src/block.ts @@ -1,149 +1,255 @@ -import {BlockPropsType, QueryBlockType} from "./types.ts"; -import $ from "jquery"; +import {BlocksDataValueType, QueryBlockType} from "./types.ts"; +// import $ from "jquery"; +import {Component} from "./library/Component.ts"; -const Block = (props: BlockPropsType) => { - const query: QueryBlockType = { - aex_only: props.aex_only === '1' ? 'Да' : 'Нет', - mst_pr_aex: props.mst_pr_aex === '1' ? 'Да' : 'Нет', - mst_pr_virt: props.mst_pr_virt === '1' ? 'Да' : 'Нет', - max_ves: props.max_ves === '0' ? 'Не установлено' : props.max_ves, - max_obyom: props.max_obyom === '0' ? 'Не установлено' : props.max_obyom, - max_ves_gm: props.max_ves_gm === '0' ? 'Не установлено' : props.max_ves_gm, - max_obyom_gm: props.max_obyom_gm === '0' ? 'Не установлено' : props.max_obyom_gm, - max_l_gm: props.max_l_gm === '0' ? 'Не установлено' : props.max_l_gm, - max_w_gm: props.max_w_gm === '0' ? 'Не установлено' : props.max_w_gm, - max_h_gm: props.max_h_gm === '0' ? 'Не установлено' : props.max_h_gm, - person_count: 'Не установлено', - features: props.features || '', - contact_profile: null, - features_changeable: "" - } +class Block extends Component { + component(props: BlocksDataValueType): string { + return ` +
Длина: ${this.props!.max_l_gm}, м
+Ширина: ${this.props!.max_w_gm}, м
+Высота: ${this.props!.max_h_gm}, м
+Длина: ${query.max_l_gm}, м
-Ширина: ${query.max_w_gm}, м
-Высота: ${query.max_h_gm}, м
-${props.features}
-${this.props!.features}
+${query.contact_profile && query.contact_profile.fullName}
-${query.contact_profile && query.contact_profile.phone}
-${query.contact_profile && query.contact_profile.email}
` : `Данные не установлены`} +${this.props!.contact_profile && this.props!.contact_profile.fullName}
+${this.props!.contact_profile && this.props!.contact_profile.phone}
+${this.props!.contact_profile && this.props!.contact_profile.email}
` : `Данные не установлены`} -Длина: ${query.max_l_gm}, м
+//Ширина: ${query.max_w_gm}, м
+//Высота: ${query.max_h_gm}, м
+//${props.features}
+//${query.contact_profile && query.contact_profile.fullName}
+//${query.contact_profile && query.contact_profile.phone}
+//${query.contact_profile && query.contact_profile.email}
` : `Данные не установлены`} +// +// +// +// +//