fix: Disable S3 image loading and fix station detail data extraction

This commit is contained in:
Eric F
2026-06-16 08:41:53 -04:00
parent c301692a98
commit c1706f337d

View File

@@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: 2025 Contributors to the CitrineOS Project
//
// SPDX-License-Identifier: Apache-2.0
// CACHE_BUST: 2026-06-16-08-30-00
'use client';
import React, { useEffect, useState } from 'react';
@@ -10,7 +11,7 @@ import { ChargingStationDetailCard } from '@lib/client/pages/charging-stations/d
import { pageFlex, pageMargin } from '@lib/client/styles/page';
import { ChargingStationDetailTabsCard } from '@lib/client/pages/charging-stations/detail/charging.station.detail.tabs.card';
import { S3_BUCKET_FOLDER_IMAGES_CHARGING_STATIONS } from '@lib/utils/consts';
import { getPresignedUrlForGet } from '@lib/server/actions/file/getPresingedUrlForGet';
// import { getPresignedUrlForGet } from '@lib/server/actions/file/getPresingedUrlForGet';
import { AccessDeniedFallbackCard } from '@lib/client/components/access-denied-fallback-card';
import { Skeleton } from '@lib/client/components/ui/skeleton';
@@ -21,16 +22,12 @@ type ChargingStationDetailProps = {
export const ChargingStationDetail: React.FC<ChargingStationDetailProps> = ({ params }) => {
const { id } = params;
const [imageUrl, setImageUrl] = useState<string | null>(null);
const [forceUpdate] = useState(Date.now()); // Force cache bust
useEffect(() => {
if (id) {
getPresignedUrlForGet(`${S3_BUCKET_FOLDER_IMAGES_CHARGING_STATIONS}/${id}`).then((result) => {
if (result.success) {
return setImageUrl(result.data);
}
});
}
}, [id]);
// S3 image loading disabled - no bucket configured
void forceUpdate; // Used to force re-render
}, [id, forceUpdate]);
if (!id) {
return (