feat: init @affine/copilot (#2511)
This commit is contained in:
19
plugins/copilot/src/core/components/conversation.tsx
Normal file
19
plugins/copilot/src/core/components/conversation.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { marked } from 'marked';
|
||||
import { type ReactElement, useMemo } from 'react';
|
||||
|
||||
export interface ConversationProps {
|
||||
text: string;
|
||||
}
|
||||
|
||||
export const Conversation = (props: ConversationProps): ReactElement => {
|
||||
const html = useMemo(() => marked.parse(props.text), [props.text]);
|
||||
return (
|
||||
<div>
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: html,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
5
plugins/copilot/src/core/components/divider.tsx
Normal file
5
plugins/copilot/src/core/components/divider.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { type ReactElement } from 'react';
|
||||
|
||||
export const Divider = (): ReactElement => {
|
||||
return <hr style={{ borderTop: '1px solid #ddd' }} />;
|
||||
};
|
||||
Reference in New Issue
Block a user