'use client'; import { HTMLAttributes } from 'react'; import styles from './depth-indicator.module.css'; export interface DepthIndicatorProps extends HTMLAttributes { currentDepth: number; minDepth?: number; maxDepth?: number; unit?: string; label?: string; position?: 'left' | 'right'; showValue?: boolean; barWidth?: number; barHeight?: number; } export const DepthIndicator = ({ currentDepth, minDepth = 0, maxDepth = 100, unit = 'm', label = 'DEPTH', position = 'left', showValue = true, className = '', ...props }: DepthIndicatorProps) => { const percentage = Math.min(100, Math.max(0, ((currentDepth - minDepth) / (maxDepth - minDepth)) * 100)); return (
{label}
{showValue && {currentDepth}{unit}}
); }; export default DepthIndicator;