This commit is contained in:
Sebastian Qvarfordt
2020-06-04 12:47:02 +02:00
committed by Sebastian Qvarfordt
parent 187d6c9103
commit 2020979780
2 changed files with 10 additions and 2 deletions
+2 -1
View File
@@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { Location } from '@backstage/catalog-model';
export type Component = {
name: string;
kind: string;
description: string;
description: React.ReactNode;
location?: Location;
};
@@ -13,8 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { Component } from './component';
import { Entity, Location } from '@backstage/catalog-model';
import Edit from '@material-ui/icons/Edit';
export function envelopeToComponent(
envelope: Entity,
@@ -23,7 +25,12 @@ export function envelopeToComponent(
return {
name: envelope.metadata?.name ?? '',
kind: envelope.kind ?? 'unknown',
description: envelope.metadata?.annotations?.description ?? 'placeholder',
description: (
<span style={{ display: 'flex', alignItems: 'center' }}>
{envelope.metadata?.annotations?.description ?? 'placeholder'}
<Edit style={{ fontSize: 20, paddingLeft: '5px' }} />
</span>
),
location,
};
}