import { useCallback, useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { clearIncomingRingtone, getIncomingRingtone, MAX_RINGTONE_BYTES, saveIncomingRingtone, type StoredRingtone, } from '../lib/ringtoneStorage'; import { PhoneIcon, SpinnerIcon, TrashIcon } from './icons'; interface Props { /** Disable interactions while a parent action is in flight. */ disabled?: boolean; } const BYTES_PER_MB = 1024 * 1024; // UI for the custom incoming-call ringtone. Single file slot. Upload // validates size + mime and surfaces errors inline. Preview button plays // the stored blob through a local