-
Notifications
You must be signed in to change notification settings - Fork 218
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 #9518 from weseek/feat/159531-chat-modal
feat: Chat Modal
- Loading branch information
Showing
4 changed files
with
90 additions
and
33 deletions.
There are no files selected for viewing
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
29 changes: 29 additions & 0 deletions
29
apps/app/src/features/openai/client/components/Common/SelectedPageList.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,29 @@ | ||
import { memo } from 'react'; | ||
|
||
import { useTranslation } from 'react-i18next'; | ||
|
||
import type { SelectedPage } from '../../../interfaces/selected-page'; | ||
|
||
export const SelectedPageList = memo(({ selectedPages, onRemove }: { selectedPages: SelectedPage[], onRemove?: (pageId?: string) => void }): JSX.Element => { | ||
const { t } = useTranslation(); | ||
|
||
if (selectedPages.length === 0) { | ||
return <></>; | ||
} | ||
|
||
return ( | ||
<div className="mb-3"> | ||
{selectedPages.map(({ page, isIncludeSubPage }) => ( | ||
<div key={page._id} className="mb-1 d-flex align-items-center"> | ||
<code>{ page.path }</code> | ||
{isIncludeSubPage && <span className="badge rounded-pill text-bg-secondary ms-2">{t('Include Subordinated Page')}</span>} | ||
{onRemove != null && page._id != null && page._id && ( | ||
<button className="btn border-0 " type="button" onClick={() => onRemove(page._id)}> | ||
<span className="fs-5 material-symbols-outlined text-secondary">delete</span> | ||
</button> | ||
)} | ||
</div> | ||
))} | ||
</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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { IPageForItem } from '~/interfaces/page'; | ||
|
||
export type SelectedPage = { | ||
page: IPageForItem, | ||
isIncludeSubPage: boolean, | ||
} |