Skip to content

Commit

Permalink
Feat/integ http (#8)
Browse files Browse the repository at this point in the history
* wip:integration HttpService

* refactor:comp MessageAIand onSubmit handler

* feat: add loader on init

* feat: add mock chat messages

* feat:add lazy loading

* feat:add related-questions block

* feat: integ appflowy editor

* fix: mock stream data text

* fix: add clearing generating body value

* fix:disabled appflowy editor

* fix: add EditorProvider for every Editor

* feat: add editor markdown render
  • Loading branch information
nik-lylo authored Dec 19, 2024
1 parent 585c3cb commit bf6ea42
Show file tree
Hide file tree
Showing 22 changed files with 2,129 additions and 318 deletions.
14 changes: 7 additions & 7 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{ ignores: ['dist'] },
Expand All @@ -24,5 +24,5 @@ export default tseslint.config(
{ allowConstantExport: true },
],
},
},
)
}
);
5 changes: 5 additions & 0 deletions lib/assets/icons/chat-outlined.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 11 additions & 18 deletions lib/components/action-bar-ai/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { ActionBarAIButtonData } from "@appflowy-chat/utils/actionBarAIButtons";
import ButtonBarAI from "../button-bar-ai";
import { FC } from "react";
import clsx from "clsx";
import ButtonBarAIPopover from "../button-bar-ai-popover";
import { AIModelName, ChatMessageAI } from "@appflowy-chat/types";
import { ActionBarAIButtonData } from '@appflowy-chat/utils/actionBarAIButtons';
import ButtonBarAI from '../button-bar-ai';
import { FC } from 'react';
import clsx from 'clsx';
import ButtonBarAIPopover from '../button-bar-ai-popover';
import { AIModelName } from '@appflowy-chat/types';
import { ChatMessage } from '@appflowy-chat/types/ai';

interface IProp {
rootClasses?: string;
buttons: ActionBarAIButtonData[];
message: ChatMessageAI;
message: ChatMessage;
onAIModelChange?: (option: AIModelName) => void;
onPopoverStateChange: (value: boolean) => void;
}

const ActionBarAI: FC<IProp> = ({
rootClasses,
buttons,
message,
onAIModelChange,
onPopoverStateChange,
}) => {
Expand All @@ -27,17 +27,10 @@ const ActionBarAI: FC<IProp> = ({
}

return (
<div className={clsx([rootClasses, "flex gap-2"])}>
<div className={clsx([rootClasses, 'flex gap-2'])}>
{buttons.map((btn) => {
if (btn.type === "btn-popover") {
let activeOption = "";

if (btn.name == "switch-model") {
activeOption = message.aiModel;
} else if (btn.name === "change-format") {
activeOption = message.formatType;
}

if (btn.type === 'btn-popover') {
const activeOption = '';
return (
<ButtonBarAIPopover
icon={btn.icon}
Expand Down
Loading

0 comments on commit bf6ea42

Please sign in to comment.