This is an automated email from the ASF dual-hosted git repository.

mintsweet pushed a commit to branch feat-dora-config
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit db3ec8d8955fa5a66fa1c8e2f29ca56f8747acd6
Author: mintsweet <0x1304...@gmail.com>
AuthorDate: Sat Sep 14 12:14:06 2024 +1200

    fix: check match items total
---
 config-ui/src/plugins/components/check-matched-items/index.tsx | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/config-ui/src/plugins/components/check-matched-items/index.tsx 
b/config-ui/src/plugins/components/check-matched-items/index.tsx
index bdfcde2ff..72eb865e2 100644
--- a/config-ui/src/plugins/components/check-matched-items/index.tsx
+++ b/config-ui/src/plugins/components/check-matched-items/index.tsx
@@ -41,7 +41,7 @@ interface Props {
 
 export const CheckMatchedItems = ({ plugin, connectionId, transformation }: 
Props) => {
   const [page, setPage] = useState(1);
-  const [total, setTotal] = useState(0);
+  const [total, setTotal] = useState<number>();
   const [loading, setLoading] = useState(false);
 
   const [state, dispatch] = useReducer(reducer, []);
@@ -69,7 +69,9 @@ export const CheckMatchedItems = ({ plugin, connectionId, 
transformation }: Prop
           Check Matched Items
         </Button>
       </div>
-      {!!state.length && (
+      {total === 0 ? (
+        <p>No item found</p>
+      ) : (
         <Flex vertical gap="small">
           <h3>Matched Items</h3>
           <Flex wrap="wrap" gap="small">
@@ -79,7 +81,7 @@ export const CheckMatchedItems = ({ plugin, connectionId, 
transformation }: Prop
               </Tag>
             ))}
           </Flex>
-          {total > state.length && (
+          {total && total > state.length && (
             <div>
               <Button type="link" size="small" loading={loading} 
icon={<PlusOutlined />} onClick={handleLoadItems}>
                 See More

Reply via email to