mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
13 lines
340 B
TypeScript
13 lines
340 B
TypeScript
import { INode } from '~/redux/types';
|
|
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,
|
|
]);
|
|
};
|