Fix: admin map
Deskripsi: - Fix map image ## No Issue
This commit is contained in:
@@ -1,16 +1,7 @@
|
||||
import { APIs } from "@/app/lib";
|
||||
"use client";
|
||||
|
||||
import { MODEL_MAP } from "@/app_modules/map/lib/interface";
|
||||
import {
|
||||
AspectRatio,
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Grid,
|
||||
Image,
|
||||
Stack,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { Box, Button, Center, Grid, Stack, Text } from "@mantine/core";
|
||||
import {
|
||||
IconBuildingSkyscraper,
|
||||
IconListDetails,
|
||||
@@ -18,42 +9,17 @@ import {
|
||||
IconPhoneCall,
|
||||
IconPinned,
|
||||
} from "@tabler/icons-react";
|
||||
import { useState } from "react";
|
||||
import { adminMap_funGetOneById } from "../fun/fun_get_one_by_id";
|
||||
import { Admin_ComponentLoadImageLandscape } from "../../_admin_global";
|
||||
|
||||
export function ComponentAdminMap_DetailDataDrawer({
|
||||
mapId,
|
||||
data,
|
||||
}: {
|
||||
mapId: string;
|
||||
data: MODEL_MAP;
|
||||
}) {
|
||||
const [data, setData] = useState<MODEL_MAP>();
|
||||
|
||||
useShallowEffect(() => {
|
||||
onLoadMap(mapId);
|
||||
}, [mapId]);
|
||||
|
||||
async function onLoadMap(mapId: string) {
|
||||
try {
|
||||
const res = await adminMap_funGetOneById({ mapId: mapId });
|
||||
setData(res as any);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<Admin_ComponentLoadImageLandscape fileId={data?.imageId as any}/>
|
||||
{/* <AspectRatio ratio={1 / 1} mah={300}>
|
||||
<Image
|
||||
radius={"md"}
|
||||
width={300}
|
||||
alt="Photo"
|
||||
src={APIs.GET({ fileId: data?.imageId as string })}
|
||||
/>
|
||||
</AspectRatio> */}
|
||||
<Admin_ComponentLoadImageLandscape fileId={data?.imageId as any} />
|
||||
|
||||
<Box>
|
||||
<Grid>
|
||||
@@ -97,7 +63,6 @@ export function ComponentAdminMap_DetailDataDrawer({
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Box>
|
||||
|
||||
{data ? (
|
||||
<Center>
|
||||
<Button
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { MODEL_MAP } from "@/app_modules/map/lib/interface";
|
||||
import {
|
||||
Drawer,
|
||||
Group,
|
||||
Text
|
||||
} from "@mantine/core";
|
||||
import { Drawer, Group, Text } from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import _ from "lodash";
|
||||
import { useState } from "react";
|
||||
@@ -55,7 +51,7 @@ export function ComponentAdminMap_Drawer({
|
||||
{_.isEmpty(data) ? (
|
||||
<ComponentAdminMap_SkeletonDrawer />
|
||||
) : (
|
||||
<ComponentAdminMap_DetailDataDrawer mapId={mapId} />
|
||||
<ComponentAdminMap_DetailDataDrawer data={data} />
|
||||
)}
|
||||
|
||||
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */}
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
"use client";
|
||||
|
||||
import { MODEL_MAP } from "@/app_modules/map/lib/interface";
|
||||
import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
|
||||
import { useState } from "react";
|
||||
import { APIs } from "@/app/lib";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import {
|
||||
defaultLatLong,
|
||||
defaultMapZoom,
|
||||
} from "@/app_modules/map/lib/default_lat_long";
|
||||
import { Avatar, Image, Paper, Stack, Text } from "@mantine/core";
|
||||
import { MODEL_MAP } from "@/app_modules/map/lib/interface";
|
||||
import { Avatar, Stack } from "@mantine/core";
|
||||
import "mapbox-gl/dist/mapbox-gl.css";
|
||||
import { useState } from "react";
|
||||
import Map, {
|
||||
AttributionControl,
|
||||
Marker,
|
||||
NavigationControl,
|
||||
ScaleControl,
|
||||
} from "react-map-gl";
|
||||
import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
|
||||
import { ComponentAdminMap_Drawer } from "../component";
|
||||
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||
import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog";
|
||||
import { RouterMap } from "@/app/lib/router_hipmi/router_map";
|
||||
import { APIs } from "@/app/lib";
|
||||
|
||||
export function UiAdminMap_MapBoxView({
|
||||
mapboxToken,
|
||||
|
||||
Reference in New Issue
Block a user