Move project from bordanlage/ to repo root
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
37
dashboard/src/components/nav/ChartPlaceholder.jsx
Normal file
37
dashboard/src/components/nav/ChartPlaceholder.jsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import { useNMEA } from '../../hooks/useNMEA.js'
|
||||
|
||||
export default function ChartPlaceholder() {
|
||||
const { lat, lon } = useNMEA()
|
||||
const signalkHost = import.meta.env.VITE_SIGNALK_HOST || 'localhost'
|
||||
|
||||
// SignalK has a built-in chart viewer
|
||||
const chartUrl = `http://${signalkHost}:3000/@signalk/freeboard-sk/`
|
||||
|
||||
return (
|
||||
<div style={styles.container}>
|
||||
<iframe
|
||||
src={chartUrl}
|
||||
style={styles.iframe}
|
||||
title="Chart"
|
||||
onError={() => {}}
|
||||
/>
|
||||
{lat != null && (
|
||||
<div style={styles.coords}>
|
||||
<span style={styles.coord}>{lat.toFixed(5)}°N</span>
|
||||
<span style={styles.coord}>{lon.toFixed(5)}°E</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const styles = {
|
||||
container: { position: 'relative', flex: 1, borderRadius: 'var(--radius)', overflow: 'hidden', border: '1px solid var(--border)' },
|
||||
iframe: { width: '100%', height: '100%', border: 'none', background: 'var(--surface2)' },
|
||||
coords: {
|
||||
position: 'absolute', bottom: 12, left: 12,
|
||||
background: '#07111fcc', borderRadius: 6, padding: '6px 10px',
|
||||
display: 'flex', gap: 12,
|
||||
},
|
||||
coord: { fontFamily: 'var(--font-mono)', fontSize: 12, color: 'var(--accent)' },
|
||||
}
|
||||
Reference in New Issue
Block a user