import { Pressable, StyleSheet, View } from 'react-native'; import { Text } from '@/components/Text'; import { radius, spacing, } from '@/theme'; import { createThemedStyles, useColors } from '@/theme/themed'; import type { EQPreset } from '@/types/audio'; import { EqSheet } from './EqSheet'; import { formatGain } from './format'; interface EQPresetPreviewSheetProps { preset: EQPreset; title?: string; confirmLabel?: string; onConfirm: () => void; onClose: () => void; } export function EQPresetPreviewSheet({ preset, title = 'Import preset', confirmLabel = 'Import and Apply', onConfirm, onClose, }: EQPresetPreviewSheetProps) { const styles = useStyles(); const colors = useColors(); const enabledBands = preset.bands.filter((band) => band.enabled).length; const modeLabel = preset.mode === 'graphic' ? 'Graphic' : 'Parametric'; return ( {title} {preset.name} Mode {modeLabel} Preamp {formatGain(preset.preamp)} dB Bands {enabledBands}/{preset.bands.length} Cancel { onConfirm(); onClose(); }} > {confirmLabel} ); } const useStyles = createThemedStyles((colors) => ({ title: { marginTop: spacing.xs, marginBottom: spacing.md, }, preview: { borderRadius: radius.md, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.glassBorder, backgroundColor: colors.glassBg, padding: spacing.md, gap: spacing.sm, }, metaRow: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: spacing.md, }, actions: { flexDirection: 'row', justifyContent: 'flex-end', gap: spacing.sm, marginTop: spacing.lg, }, btn: { paddingHorizontal: spacing.lg, paddingVertical: spacing.md, borderRadius: radius.pill, }, cancel: { borderWidth: StyleSheet.hairlineWidth, borderColor: colors.glassBorder, }, primary: { backgroundColor: colors.accentGlow, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.accent, }, })); export default EQPresetPreviewSheet;