From ea230c4754aca6bf11545cbf12e8784b88bb8ef5 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sun, 21 Mar 2021 12:49:14 +0300
Subject: feat: do now show delete button on create screen

---
 src/containers/Service/ServiceItem.tsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/containers/Service/ServiceItem.tsx')

diff --git a/src/containers/Service/ServiceItem.tsx b/src/containers/Service/ServiceItem.tsx
index c1f5446..22357c7 100644
--- a/src/containers/Service/ServiceItem.tsx
+++ b/src/containers/Service/ServiceItem.tsx
@@ -30,11 +30,11 @@ const ServiceItem: React.FC = () => {
     });
   };
 
-  const actions: Action[] = [
+  const actions: Action[] = _.compact([
     { name: 'Назад', variant: 'outlined', onClick: history.goBack },
-    { name: 'Удалить', variant: 'outlined', onClick: handleDelete },
+    id && { name: 'Удалить', variant: 'outlined', onClick: handleDelete },
     { name: 'Сохранить', type: 'submit', form: 'form' },
-  ];
+  ]);
 
   return (
     <Page
-- 
cgit v1.2.3

