<!--
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<kd-card [initialized]="initialized">
  <div title
       i18n>Metadata</div>
  <div description>
    <div class="kd-inline-property">
      <span class="kd-muted-light"
            i18n>Name:&nbsp;</span>
      <span>{{objectMeta?.name}}</span>
    </div>
    <div class="kd-inline-property"
         *ngIf="objectMeta?.namespace">
      <span class="kd-muted-light"
            i18n>Namespace:&nbsp;</span>
      <span>{{objectMeta?.namespace}}</span>
    </div>
    <div class="kd-inline-property"
         *ngIf="objectMeta?.creationTimestamp">
      <span class="kd-muted-light"
            i18n>Age:&nbsp;</span>
      <kd-date [date]="objectMeta?.creationTimestamp"
               relative></kd-date>
    </div>
  </div>
  <div content>
    <div fxLayout="row wrap">
      <kd-property [ngClass]="'object-meta-name'">
        <div key
             i18n>Name</div>
        <div value>{{objectMeta?.name}}</div>
      </kd-property>
      <kd-property *ngIf="objectMeta?.namespace"
                   [ngClass]="'object-meta-namespace'">
        <div key
             i18n>Namespace</div>
        <div value>{{objectMeta?.namespace}}</div>
      </kd-property>
      <kd-property [ngClass]="'object-meta-creation'">
        <div key
             i18n>Created</div>
        <div value>
          <kd-date [date]="objectMeta?.creationTimestamp"></kd-date>
        </div>
      </kd-property>
      <kd-property [ngClass]="'object-meta-age'">
        <div key
             i18n>Age</div>
        <div value>
          <kd-date [date]="objectMeta?.creationTimestamp"
                   relative></kd-date>
        </div>
      </kd-property>
      <kd-property *ngIf="objectMeta?.uid"
                   [ngClass]="'object-meta-uid'">
        <div key
             i18n>UID</div>
        <div value>{{objectMeta?.uid}}</div>
      </kd-property>
      <kd-property *ngIf="objectMeta?.labels"
                   fxFlex="100"
                   [ngClass]="'object-meta-labels'">
        <div key
             i18n>Labels</div>
        <div value>
          <kd-chips [map]="objectMeta?.labels"
                    [displayAll]="true"></kd-chips>
        </div>
      </kd-property>
      <kd-property *ngIf="objectMeta?.annotations"
                   fxFlex="100"
                   [ngClass]="'object-meta-annotations'">
        <div key
             i18n>Annotations</div>
        <div value>
          <kd-chips [map]="objectMeta?.annotations"
                    [displayAll]="true"></kd-chips>
        </div>
      </kd-property>
    </div>
  </div>
</kd-card>
