Files
Folo/packages/internal/components/src/utils/icon.ts
T
Innei 4d746522f1 refactor: remove unused files and clean up project structure
- Deleted obsolete configuration files and unused components across various packages.
- Updated package.json files to reflect the removal of dependencies.
- Cleaned up code by removing unnecessary exports and unused imports in multiple modules.

Signed-off-by: Innei <tukon479@gmail.com>
2025-04-28 20:58:51 +08:00

34 lines
631 B
TypeScript

import { getImageProxyUrl } from "@follow/utils/img-proxy"
import { getUrlIcon } from "@follow/utils/utils"
export const getFeedIconSrc = ({
src,
siteUrl,
fallback,
proxy,
}: {
src?: string
siteUrl?: string
fallback?: boolean
proxy?: { height: number; width: number }
} = {}) => {
if (src) {
if (proxy) {
return [
getImageProxyUrl({
url: src,
width: proxy.width,
height: proxy.height,
}),
"",
]
}
return [src, ""]
}
if (!siteUrl) return ["", ""]
const ret = getUrlIcon(siteUrl, fallback)
return [ret.src, ret.fallbackUrl]
}