diff --git a/app/satellites/SatelliteTable.tsx b/app/satellites/SatelliteTable.tsx index 3ba7d5e..3dfe4a5 100644 --- a/app/satellites/SatelliteTable.tsx +++ b/app/satellites/SatelliteTable.tsx @@ -112,8 +112,8 @@ const SatelliteTableRow = ({ ? Buffer.from(str).toString('base64') : window.btoa(str) - const SideLoadingPlaceholder = ({ text }: { text: string }) => ( -
+ const SideLoadingPlaceholder = ({ text, className }: { text: string, className?: string }) => ( +

{ text }

@@ -122,7 +122,7 @@ const SatelliteTableRow = ({ const { data: sightingData, isLoading: isSightingLoading, - } = useSWR(expanded && { + } = useSWR(sidePopVisible && { resource: 'https://ham-api.c5r.app/sat/sightings', init: { method: 'POST', @@ -268,19 +268,98 @@ const SatelliteTableRow = ({ ) } setSidePopVisible(false) } size={ 'medium' } className={ '!w-full md:!w-auto' } > - { isTransmittersLoading ? - :
- { transmittersData?.data && transmittersData.data.map(transponder => ( - - )) } -
- } + { isSightingLoading ? + + : ( + <> +

+ + 未来 24 小时过境 +

+
+ { (sightingData && typeof sightingData.length === 'number') && sightingData.map((sighting, index) => ( +
+
+
+ { dayjs(sighting.rise.time).format('YYYY-MM-DD') } +
+
+
+
+ + { dayjs(sighting.rise.time).format('HH:mm:ss') } +
+
+ + { Math.floor((dayjs(sighting.set.time).unix() - dayjs(sighting.rise.time).unix()) / 60) }min +
+
+ + { dayjs(sighting.set.time).format('HH:mm:ss') } +
+
+
+
+ + : { sighting.rise.azimuth }° +
+
+ + { sighting.culminate.elevation }° +
+
+ + : { sighting.set.azimuth }° +
+
+
+ )) } +
+ + ) } + + { isTransmittersLoading ? + + : ( + <> +

+ + 卫星收发器 +

+
+ { transmittersData?.data && transmittersData.data.map(transponder => ( + + )) } +
+ + ) }
)