remove proxy

This commit is contained in:
hamid zarghami
2026-06-06 09:51:23 +03:30
parent e68543f869
commit e948b00f55
2 changed files with 27 additions and 30 deletions
+10
View File
@@ -0,0 +1,10 @@
---
description: پاسخ‌های Agent همیشه به فارسی باشد
alwaysApply: true
---
# زبان پاسخ
- همیشه به **فارسی (Farsi)** پاسخ بده.
- مگر اینکه کاربر صریحاً زبان دیگری بخواهد.
- کد، نام متغیرها، و کامنت‌های کد را به انگلیسی نگه دار؛ فقط توضیحات و متن‌های کاربرپسند را فارسی بنویس.
@@ -20,43 +20,30 @@ function CategoryImage({
src,
size,
alt,
proxyBase,
// proxyBase,
}: {
src: string;
size: number;
alt: string;
proxyBase: string | null;
// proxyBase: string | null;
}) {
const isSvg = src.endsWith(".svg");
if (isSvg) {
const isSameOrigin =
src.startsWith("/") ||
(typeof window !== "undefined" &&
new URL(src, window.location.href).origin === window.location.origin);
const maskUrl = isSameOrigin
? src
: proxyBase
? `${proxyBase}/api/proxy-svg?url=${encodeURIComponent(src)}`
: null;
if (maskUrl) {
return (
<div
className="shrink-0 bg-primary"
style={{
width: size,
height: size,
maskImage: `url(${maskUrl})`,
WebkitMaskImage: `url(${maskUrl})`,
...SVG_MASK_STYLE,
}}
role="img"
aria-label={alt}
/>
);
}
return (
<div
className="shrink-0 bg-primary"
style={{
width: size,
height: size,
maskImage: `url(${src})`,
WebkitMaskImage: `url(${src})`,
...SVG_MASK_STYLE,
}}
role="img"
aria-label={alt}
/>
);
return (
// eslint-disable-next-line @next/next/no-img-element
@@ -160,7 +147,7 @@ const CategoryScroll = ({
src={item.avatarUrl || "/assets/images/food-image.png"}
size={imageSize}
alt="category image"
proxyBase={proxyBase}
// proxyBase={proxyBase}
/>
<span className="text-xs text-foreground text-center">
{item.title}