Shun Miyazawa пре 4 година
родитељ
комит
0a0f5047d1

+ 2 - 6
packages/app/src/components/TagCloudBox.tsx

@@ -2,14 +2,10 @@ import React, { FC } from 'react';
 
 
 import { TagCloud } from 'react-tagcloud';
 import { TagCloud } from 'react-tagcloud';
 
 
-type Tag = {
-  _id: string,
-  name: string,
-  count: number,
-}
+import { ITagHasCount } from '~/interfaces/tag';
 
 
 type Props = {
 type Props = {
-  tags:Tag[],
+  tags: ITagHasCount[],
   minSize?: number,
   minSize?: number,
   maxSize?: number,
   maxSize?: number,
 }
 }

+ 2 - 0
packages/app/src/interfaces/tag.ts

@@ -3,6 +3,8 @@ export type ITag = {
   createdAt: Date;
   createdAt: Date;
 }
 }
 
 
+export type ITagHasCount = ITag & { count: number }
+
 export type ITagsSearchApiv1Result = {
 export type ITagsSearchApiv1Result = {
   ok: boolean,
   ok: boolean,
   tags: string[]
   tags: string[]

+ 1 - 3
packages/app/src/stores/tag.tsx

@@ -1,13 +1,11 @@
 import { SWRResponse } from 'swr';
 import { SWRResponse } from 'swr';
 import useSWRImmutable from 'swr/immutable';
 import useSWRImmutable from 'swr/immutable';
 
 
-import { ITag } from '~/interfaces/tag';
+import { ITagHasCount } from '~/interfaces/tag';
 
 
 import { apiGet } from '../client/util/apiv1-client';
 import { apiGet } from '../client/util/apiv1-client';
 
 
 
 
-export type ITagHasCount = ITag & { count: number }
-
 export type ITagsApiv1Result = {
 export type ITagsApiv1Result = {
   ok: boolean,
   ok: boolean,
   data: ITagHasCount[],
   data: ITagHasCount[],