Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

797 B
Raw Blame
import { type FC } from 'react';

import { LOCAL_FILE_TAG } from '@/const/plugin';

import { createRemarkSelfClosingTagPlugin } from '../remarkPlugins/createRemarkSelfClosingTagPlugin';
import { type MarkdownElement, type MarkdownElementProps } from '../type';
import RenderComponent from './Render';

// Define the tag name for this element

const LocalFileElement: MarkdownElement = {
  Component: RenderComponent as FC<MarkdownElementProps>,
  remarkPlugin: createRemarkSelfClosingTagPlugin(LOCAL_FILE_TAG),
  // The chat input serializes attached files to `<localFile … />`, so user
  // messages rendered from plain markdown (history replay / sync / share)
  // need this plugin too — not only assistant output.
  scope: 'all',
  tag: LOCAL_FILE_TAG,
};

export default LocalFileElement;