| LucideIcon> = {
+ page: PageIcon,
+ project: ProjectIcon,
+ view: ViewsIcon,
+ module: ModuleIcon,
+ cycle: CycleIcon,
+ folder: FavoriteFolderIcon,
+};
+
+type Props = {
+ type: string;
+ logo?: TLogoProps;
+};
+
+export const FavoriteItemIcon = ({ type, logo }: Props) => {
+ const Icon = ICON_MAP[type] ?? PageIcon;
+
+ return (
+ <>
+
+
+
+
+ {logo?.in_use ? (
+
+ ) : (
+
+ )}
+
+ >
+ );
+};
diff --git a/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/helper.tsx b/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/helper.tsx
index f7de5b9214..ae4bb44cfa 100644
--- a/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/helper.tsx
+++ b/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/helper.tsx
@@ -4,32 +4,8 @@
* See the LICENSE file for details.
*/
-import { Logo } from "@plane/propel/emoji-icon-picker";
-import { PageIcon } from "@plane/propel/icons";
-// plane imports
-import type { IFavorite, TLogoProps } from "@plane/types";
-// components
-// plane web constants
-import { FAVORITE_ITEM_ICONS, FAVORITE_ITEM_LINKS } from "@/constants/sidebar-favorites";
-
-export const getFavoriteItemIcon = (type: string, logo?: TLogoProps) => {
- const Icon = FAVORITE_ITEM_ICONS[type] || PageIcon;
-
- return (
- <>
-
-
-
-
- {logo?.in_use ? (
-
- ) : (
-
- )}
-
- >
- );
-};
+import { FAVORITE_ITEM_LINKS } from "@plane/constants";
+import type { IFavorite } from "@plane/types";
export const generateFavoriteItemLink = (workspaceSlug: string, favorite: IFavorite) => {
const entityLinkDetails = FAVORITE_ITEM_LINKS[favorite.entity_type];
diff --git a/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/index.ts b/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/index.ts
index c044bec246..4e13083a93 100644
--- a/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/index.ts
+++ b/apps/web/core/components/workspace/sidebar/favorites/favorite-items/common/index.ts
@@ -5,6 +5,7 @@
*/
export * from "./favorite-item-drag-handle";
+export * from "./favorite-item-icon";
export * from "./favorite-item-quick-action";
export * from "./favorite-item-wrapper";
export * from "./favorite-item-title";
diff --git a/apps/web/core/hooks/use-favorite-item-details.tsx b/apps/web/core/hooks/use-favorite-item-details.tsx
index b3c9468e39..ef2a296a08 100644
--- a/apps/web/core/hooks/use-favorite-item-details.tsx
+++ b/apps/web/core/hooks/use-favorite-item-details.tsx
@@ -9,8 +9,8 @@ import type { IFavorite } from "@plane/types";
// components
import { getPageName } from "@plane/utils";
import {
+ FavoriteItemIcon,
generateFavoriteItemLink,
- getFavoriteItemIcon,
} from "@/components/workspace/sidebar/favorites/favorite-items/common";
// helpers
// hooks
@@ -53,23 +53,23 @@ export const useFavoriteItemDetails = (workspaceSlug: string, favorite: IFavorit
switch (favoriteItemEntityType) {
case "project":
itemTitle = currentProjectDetails?.name ?? favoriteItemName;
- itemIcon = getFavoriteItemIcon("project", currentProjectDetails?.logo_props || favoriteItemLogoProps);
+ itemIcon = ;
break;
case "page":
itemTitle = getPageName(pageDetail?.name ?? favoriteItemName);
- itemIcon = getFavoriteItemIcon("page", pageDetail?.logo_props ?? favoriteItemLogoProps);
+ itemIcon = ;
break;
case "view":
itemTitle = viewDetails?.name ?? favoriteItemName;
- itemIcon = getFavoriteItemIcon("view", viewDetails?.logo_props || favoriteItemLogoProps);
+ itemIcon = ;
break;
case "cycle":
itemTitle = cycleDetail?.name ?? favoriteItemName;
- itemIcon = getFavoriteItemIcon("cycle");
+ itemIcon = ;
break;
case "module":
itemTitle = moduleDetail?.name ?? favoriteItemName;
- itemIcon = getFavoriteItemIcon("module");
+ itemIcon = ;
break;
default: {
const additionalDetails = getAdditionalFavoriteItemDetails(workspaceSlug, favorite);
diff --git a/apps/web/core/constants/sidebar-favorites.ts b/packages/constants/src/sidebar-favorites.ts
similarity index 65%
rename from apps/web/core/constants/sidebar-favorites.ts
rename to packages/constants/src/sidebar-favorites.ts
index e2935a6a5a..af8d740749 100644
--- a/apps/web/core/constants/sidebar-favorites.ts
+++ b/packages/constants/src/sidebar-favorites.ts
@@ -4,21 +4,8 @@
* See the LICENSE file for details.
*/
-import type { LucideIcon } from "lucide-react";
-// plane imports
-import type { ISvgIcons } from "@plane/propel/icons";
-import { CycleIcon, FavoriteFolderIcon, ModuleIcon, PageIcon, ProjectIcon, ViewsIcon } from "@plane/propel/icons";
import type { IFavorite } from "@plane/types";
-export const FAVORITE_ITEM_ICONS: Record | LucideIcon> = {
- page: PageIcon,
- project: ProjectIcon,
- view: ViewsIcon,
- module: ModuleIcon,
- cycle: CycleIcon,
- folder: FavoriteFolderIcon,
-};
-
export const FAVORITE_ITEM_LINKS: {
[key: string]: {
itemLevel: "project" | "workspace";