import { TElement } from '@udecode/plate-common';

import { ELEMENT_ATTACHMENT_AUDIO } from '../audio';
import { ELEMENT_ATTACHMENT_DOCUMENT } from '../document';
import { ELEMENT_ATTACHMENT_IMAGE } from '../image';
import { ELEMENT_ATTACHMENT_VIDEO } from '../video';

export function isAttachment(node: TElement): boolean {
  return [
    ELEMENT_ATTACHMENT_AUDIO,
    ELEMENT_ATTACHMENT_DOCUMENT,
    ELEMENT_ATTACHMENT_IMAGE,
    ELEMENT_ATTACHMENT_VIDEO,
  ].includes(node.type);
}
