Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/integ http #8

Merged
merged 13 commits into from
Dec 19, 2024
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
Loading