import * as React from 'react'; import { PanelSettings } from '../../models'; import { CommandToCode } from '../CommandToCode'; import { MessageHelper } from '../helper/MessageHelper'; import { Collapsible } from './Collapsible'; import { GlobalSettings } from './GlobalSettings'; import { OtherActions } from './OtherActions'; export interface IBaseViewProps { settings: PanelSettings | undefined; } export const BaseView: React.FunctionComponent = ({settings}: React.PropsWithChildren) => { const initProject = () => { MessageHelper.sendMessage(CommandToCode.initProject); }; const createContent = () => { MessageHelper.sendMessage(CommandToCode.createContent); }; const openFile = (filePath: string) => { MessageHelper.sendMessage(CommandToCode.openInEditor, filePath); }; return (
{ settings?.contentInfo && (
{ settings.contentInfo.map(folder => (
{folder.title}: {folder.files} file{folder.files > 1 ? 's' : ''} { folder.lastModified && (
    { folder.lastModified.map(file => (
  • openFile(file.filePath)}>{file.fileName}
  • )) }
) }
)) }
) }
); };