-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
851032d
commit 55871b1
Showing
4 changed files
with
28 additions
and
62 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
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,28 +1,10 @@ | ||
import ArrowSvg from './svg/ArrowSvg'; | ||
import NftSvg from './svg/NftSvg'; | ||
import RequestSvg from './svg/RequestSvg'; | ||
import SwapSvg from './svg/SwapSvg'; | ||
import TokenSvg from './svg/TokenSvg'; | ||
import WalletSvg from './svg/WalletSvg'; | ||
import type { StreamEntry } from './types'; | ||
|
||
export const getActionIcon = (type: StreamEntry['type']) => { | ||
switch (type) { | ||
case 'create_wallet': | ||
return <WalletSvg />; | ||
case 'request_faucet_funds': | ||
return <RequestSvg />; | ||
case 'get_balance': | ||
return <WalletSvg />; | ||
case 'swap_token': | ||
return <SwapSvg />; | ||
case 'tools': | ||
return <TokenSvg />; | ||
case 'transfer_nft': | ||
return <NftSvg />; | ||
case 'user': | ||
return <ArrowSvg className="-rotate-45 w-3 w-3" />; | ||
default: | ||
return null; | ||
} | ||
}; | ||
export function markdownToPlainText(markdown: string) { | ||
return markdown | ||
.replace(/[#*_~`>]/g, '') // Remove Markdown syntax characters | ||
.replace(/\[(.*?)\]\((.*?)\)/g, '$2') // Replace links [title](url) with url | ||
.replace(/!\[(.*?)\]\(.*?\)/g, '$1') // Replace images ![alt](url) with "alt" | ||
.replace(/>\s?/g, '') // Remove blockquotes | ||
.replace(/^\s*-\s+/gm, '\n- ') // Retain unordered list markers | ||
.replace(/\n+/g, '\n') // Collapse multiple newlines | ||
.trim(); // Remove leading/trailing whitespace | ||
} |
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
name = "api" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Your Name <[email protected]>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
|