added IMage store in idex db

This commit is contained in:
2025-08-26 17:25:04 +05:30
parent 441f1efb23
commit d4f12d230f
9 changed files with 152 additions and 33 deletions

View File

@@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
import Search from "../../ui/inputs/Search";
import { getCategoryAsset } from "../../../services/factoryBuilder/asset/assets/getCategoryAsset";
import { fetchAssets } from "../../../services/marketplace/fetchAssets";
import { useDecalStore, useSelectedItem } from "../../../store/builder/store";
import { useDecalStore, useDroppedDecal, useSelectedItem } from "../../../store/builder/store";
// images -------------------
import vehicle from "../../../assets/image/categories/vehicles.png";
@@ -21,7 +21,6 @@ import {
HangTagIcon,
NavigationIcon,
} from "../../icons/ExportCommonIcons";
import { assert } from "console";
import { getCategoryDecals } from "../../../services/factoryBuilder/asset/decals/getCategoryDecals";
// -------------------------------------
@@ -46,6 +45,7 @@ interface CategoryListProp {
}
const Assets: React.FC = () => {
const { setSelectedItem } = useSelectedItem();
const { setDroppedDecal } = useDroppedDecal();
const [searchValue, setSearchValue] = useState<string>("");
const [selectedCategory, setSelectedCategory] = useState<string | null>(null);
const [categoryAssets, setCategoryAssets] = useState<AssetProp[]>([]);
@@ -304,15 +304,11 @@ const Assets: React.FC = () => {
alt={asset.decalName}
className="asset-image"
onPointerDown={() => {
setSelectedItem({
name: asset.decalName,
id: asset.id,
type:
asset.type === "undefined"
? undefined
: asset.type,
setDroppedDecal({
category: asset.category,
// subType: asset.subType,
decalName: asset.decalName,
decalImage: asset.decalImage,
decalId: asset.id
});
}}
/>