- 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>
34 lines
631 B
TypeScript
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]
|
|
}
|