- {/* TODO(mtlewis) figure out flash of error state when entities are loading */}
- {/* TODO(mtlewis) move loading, error handling etc. inside card list */}
- {loading && }
-
- {error && (
-
- {error.message}
-
- )}
-
- {!error && !loading && entities && !entities.length && (
-
- No templates found that match your filter. Learn more about{' '}
-
- adding templates
-
- .
-
- )}
-
-
- {entities &&
- entities?.length > 0 &&
- entities.map((template, i) => (
-
- ))}
-
+
diff --git a/plugins/scaffolder/src/components/TemplateList/TemplateList.tsx b/plugins/scaffolder/src/components/TemplateList/TemplateList.tsx
new file mode 100644
index 0000000000..4b9a7030d9
--- /dev/null
+++ b/plugins/scaffolder/src/components/TemplateList/TemplateList.tsx
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2021 The Backstage 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.
+ */
+
+import React from 'react';
+import { TemplateEntityV1alpha1 } from '@backstage/catalog-model';
+import {
+ ItemCardGrid,
+ Progress,
+ WarningPanel,
+} from '@backstage/core-components';
+import { useEntityListProvider } from '@backstage/plugin-catalog-react';
+import { Link, Typography } from '@material-ui/core';
+import { TemplateCard } from '../TemplateCard';
+
+export const TemplateList = () => {
+ const { loading, error, entities } = useEntityListProvider();
+ return (
+ <>
+ {/* TODO(mtlewis) figure out flash of error state when entities are loading */}
+ {loading && }
+
+ {error && (
+
+ {error.message}
+
+ )}
+
+ {!error && !loading && entities && !entities.length && (
+
+ No templates found that match your filter. Learn more about{' '}
+
+ adding templates
+
+ .
+
+ )}
+
+
+ {entities &&
+ entities?.length > 0 &&
+ entities.map((template, i) => (
+
+ ))}
+
+ >
+ );
+};
diff --git a/plugins/scaffolder/src/components/TemplateList/index.ts b/plugins/scaffolder/src/components/TemplateList/index.ts
new file mode 100644
index 0000000000..b9ec700d74
--- /dev/null
+++ b/plugins/scaffolder/src/components/TemplateList/index.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2020 The Backstage 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.
+ */
+export { TemplateList } from './TemplateList';