mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
#23 added labs layout
This commit is contained in:
parent
8316b46efe
commit
18ec220a4e
14 changed files with 135 additions and 65 deletions
|
@ -3,6 +3,10 @@ import { useMemo } from 'react';
|
|||
import { UPLOAD_TYPES } from '~/redux/uploads/constants';
|
||||
|
||||
export const useNodeAudios = (node: INode) => {
|
||||
if (!node?.files) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return useMemo(() => node.files.filter(file => file && file.type === UPLOAD_TYPES.AUDIO), [
|
||||
node.files,
|
||||
]);
|
||||
|
|
|
@ -3,6 +3,10 @@ import { useMemo } from 'react';
|
|||
import { UPLOAD_TYPES } from '~/redux/uploads/constants';
|
||||
|
||||
export const useNodeImages = (node: INode) => {
|
||||
if (!node?.files) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return useMemo(() => node.files.filter(file => file && file.type === UPLOAD_TYPES.IMAGE), [
|
||||
node.files,
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue