2
* Copyright 2023 The Backstage Authors
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
17
import React from 'react';
21
createExtensionDataRef,
26
} from '@backstage/frontend-plugin-api';
27
import { compatWrapper } from '@backstage/core-compat-api';
29
const rootRouteRef = createRouteRef();
34
export const titleExtensionDataRef = createExtensionDataRef<string>('title');
36
const homePage = createPageExtension({
38
routeRef: rootRouteRef,
40
props: createExtensionInput(
42
children: coreExtensionData.reactElement.optional(),
43
title: titleExtensionDataRef.optional(),
52
loader: ({ inputs }) =>
53
import('./components/').then(m =>
55
<m.HomepageCompositionRoot
56
children={inputs.props?.output.children}
57
title={inputs.props?.output.title}
66
export default createPlugin({
68
extensions: [homePage],