keigo-h 3 лет назад
Родитель
Сommit
592867308a

+ 2 - 7
packages/app/src/components/ShareLink/ShareLink.tsx

@@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next';
 import PageContainer from '~/client/services/PageContainer';
 import { toastSuccess, toastError } from '~/client/util/apiNotification';
 import { apiv3Delete, apiv3Get } from '~/client/util/apiv3-client';
-import { useCurrentPageId } from '~/stores/context';
+import { IResShareLinkList } from '~/interfaces/share-link';
 
 import { withUnstatedContainers } from '../UnstatedUtils';
 
@@ -18,16 +18,11 @@ type Props = {
   pageContainer: PageContainer;
 }
 
-// TODO: specify more detailed type
-type ShareLinkItemType = {
-  any;
-};
-
 const ShareLink: FC<Props> = (props: Props): JSX.Element => {
   const { t } = useTranslation();
   const { pageContainer } = props;
   const { pageId } = pageContainer.state;
-  const [shareLinks, setShareLinks] = useState<ShareLinkItemType[]>([]);
+  const [shareLinks, setShareLinks] = useState<IResShareLinkList>([]);
   const [isOpenShareLinkForm, setIsOpenShareLinkForm] = useState<boolean>(false);
 
   const retrieveShareLinks = useCallback(async() => {

+ 2 - 0
packages/app/src/interfaces/share-link.ts

@@ -0,0 +1,2 @@
+// Todo: specify more detailed Type
+export type IResShareLinkList = any[];