-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from hatsu38/feature/pdfAttach-asSoonAs-chatRe…
…quest ファイルを添付したらすぐにAIに要約のリクエストを送る + 本文と要約を横並びに表示にする
- Loading branch information
Showing
11 changed files
with
185 additions
and
101 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/components/elements/DotLoadingAnimation/DotLoadingAnimation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React, { FC } from "react"; | ||
|
||
type PropsType = { | ||
className?: string; | ||
}; | ||
|
||
export const DotLoadingAnimation: FC<PropsType> = ({ | ||
className = "", | ||
}: PropsType) => { | ||
return ( | ||
<div className={`flex items-center space-x-4 ${className}`}> | ||
<span className="w-1 h-1 bg-primary-800 rounded-full animate-ping" /> | ||
<span className="w-1 h-1 bg-primary-800 rounded-full animate-ping" /> | ||
<span className="w-1 h-1 bg-primary-800 rounded-full animate-ping" /> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { DropzoneFileField } from "./elements/DropzoneFileField/DropzoneFileField"; | ||
export { Icon } from "./elements/Icon/Icon"; | ||
export { Button } from "./elements/Button/Button"; | ||
export { DotLoadingAnimation } from "./elements/DotLoadingAnimation/DotLoadingAnimation"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { FC } from "react"; | ||
|
||
import { DotLoadingAnimation } from "@keiyomi/components"; | ||
import { SectionType, SummarySectionType } from "@keiyomi/features/home"; | ||
|
||
type PropsType = { | ||
isLoading: boolean; | ||
title: string; | ||
sections: SectionType[] | SummarySectionType[]; | ||
className?: string; | ||
}; | ||
|
||
export const SectionsBlock: FC<PropsType> = ({ | ||
isLoading, | ||
title, | ||
sections, | ||
className = "", | ||
}) => { | ||
const array = ["🤖", "🦾", "⚒️", "⏳", "🏋️"]; | ||
const randomIndex = Math.floor(Math.random() * array.length); | ||
const randomValue = array[randomIndex]; | ||
return ( | ||
<div | ||
className={`shadow-lg w-full bg-white px-10 py-8 rounded-lg ${className}`} | ||
> | ||
<h3 className="text-center font-bold text-xl">{title}</h3> | ||
{isLoading ? ( | ||
<div className="mt-8 text-center text-sm text-gray-600 space-y-3"> | ||
<span className="">AIによる要約中です{randomValue}</span> | ||
<DotLoadingAnimation className="justify-center" /> | ||
</div> | ||
) : ( | ||
sections.map((item, index) => ( | ||
<section className="pt-10" key={`${item.sectionId}-${index}`}> | ||
<h2 className="text-gray-600 font-bold">{item.sectionTitle}</h2> | ||
<p className="text-sm whitespace-pre-wrap"> | ||
{"sectionSummary" in item | ||
? item.sectionSummary | ||
: item.sectionContent} | ||
</p> | ||
</section> | ||
)) | ||
)} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.