1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15import { Constants } from '../model/common/Constants';
16
17@Component
18export struct DetailsDialogComponent {
19  title?: Resource;
20  content: string | Resource = '';
21  colon: string = ': ';
22  isLast: boolean = false;
23  keyForAutoTest: string = '';
24
25  build() {
26    Row() {
27      Text(this.title)
28        .key('KeyOf' + this.keyForAutoTest)
29        .fontSize($r('sys.float.ohos_id_text_size_body2'))
30        .fontFamily($r('app.string.id_text_font_family_regular'))
31        .fontColor($r('sys.color.ohos_id_color_text_primary'))
32
33      Text(this.colon)
34        .fontSize($r('sys.float.ohos_id_text_size_body2'))
35        .fontFamily($r('app.string.id_text_font_family_regular'))
36        .fontColor($r('sys.color.ohos_id_color_text_primary'))
37
38      Text(this.content)
39        .key('ValueOf' + this.keyForAutoTest)
40        .fontSize($r('sys.float.ohos_id_text_size_body2'))
41        .fontFamily($r('app.string.id_text_font_family_regular'))
42        .fontColor($r('sys.color.ohos_id_color_text_secondary'))
43        .margin({
44          right: $r('app.float.details_dialog_text_margin_right')
45        })
46    }
47    .width('100%')
48    .margin({
49      bottom: this.isLast ? $r('sys.float.ohos_id_elements_margin_vertical_l') : $r('sys.float.ohos_id_text_paragraph_margin_s')
50    })
51    .alignItems(VerticalAlign.Top)
52  }
53}