mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
#23 adde comment_count and last_seen to lab
This commit is contained in:
parent
ccec211727
commit
5f938cfa92
4 changed files with 18 additions and 6 deletions
|
@ -1,6 +1,5 @@
|
|||
import React, { FC } from 'react';
|
||||
import { Group } from '~/components/containers/Group';
|
||||
import { Icon } from '~/components/input/Icon';
|
||||
import { INodeComponentProps } from '~/redux/node/constants';
|
||||
import { Filler } from '~/components/containers/Filler';
|
||||
import styles from './styles.module.scss';
|
||||
|
|
|
@ -2,15 +2,22 @@ import React, { FC } from 'react';
|
|||
import { INode } from '~/redux/types';
|
||||
import { useNodeBlocks } from '~/utils/hooks/node/useNodeBlocks';
|
||||
import styles from './styles.module.scss';
|
||||
import { LabBottomPanel } from '~/components/lab/LabBottomPanel';
|
||||
|
||||
interface IProps {
|
||||
node: INode;
|
||||
isLoading?: boolean;
|
||||
}
|
||||
|
||||
const LabNode: FC<IProps> = ({ node }) => {
|
||||
const LabNode: FC<IProps> = ({ node, isLoading }) => {
|
||||
const { lab } = useNodeBlocks(node, false);
|
||||
|
||||
return <div className={styles.wrap}>{lab}</div>;
|
||||
return (
|
||||
<div className={styles.wrap}>
|
||||
{lab}
|
||||
<LabBottomPanel node={node} isLoading={!!isLoading} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export { LabNode };
|
||||
|
|
|
@ -12,7 +12,7 @@ const LabGrid: FC<IProps> = () => {
|
|||
return (
|
||||
<div className={styles.wrap}>
|
||||
{nodes.map(node => (
|
||||
<LabNode node={node} key={node.id} />
|
||||
<LabNode node={node.node} key={node.node.id} />
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -3,7 +3,7 @@ import { IError, INode, ITag } from '~/redux/types';
|
|||
export type ILabState = Readonly<{
|
||||
list: {
|
||||
is_loading: boolean;
|
||||
nodes: INode[];
|
||||
nodes: ILabNode[];
|
||||
count: number;
|
||||
error: IError;
|
||||
};
|
||||
|
@ -19,8 +19,14 @@ export type GetLabNodesRequest = {
|
|||
after?: string;
|
||||
};
|
||||
|
||||
export interface ILabNode {
|
||||
node: INode;
|
||||
last_seen: string | null;
|
||||
comment_count: number;
|
||||
}
|
||||
|
||||
export type GetLabNodesResult = {
|
||||
nodes: INode[];
|
||||
nodes: ILabNode[];
|
||||
count: number;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue