import clsx from 'clsx'; import React from 'react'; import { useReaderStore } from '@/store/readerStore'; import { HighlightColor, HighlightStyle } from '@/types/book'; import { FaCheckCircle } from 'react-icons/fa'; const styles = ['highlight', 'underline', 'squiggly'] as HighlightStyle[]; const colors = ['red', 'violet', 'blue', 'green', 'yellow'] as HighlightColor[]; interface HighlightOptionsProps { style: React.CSSProperties; selectedStyle: HighlightStyle; selectedColor: HighlightColor; onHandleHighlight: (update: boolean) => void; } const HighlightOptions: React.FC = ({ style, selectedStyle, selectedColor, onHandleHighlight, }) => { const { settings, setSettings } = useReaderStore(); const globalReadSettings = settings.globalReadSettings; const handleSelectStyle = (style: HighlightStyle) => { globalReadSettings.highlightStyle = style; setSettings(settings); onHandleHighlight(true); }; const handleSelectColor = (color: HighlightColor) => { const style = globalReadSettings.highlightStyle; globalReadSettings.highlightStyles[style] = color; setSettings(settings); onHandleHighlight(true); }; return (
{styles.map((style) => ( ))}
{colors.map((color) => ( ))}
); }; export default HighlightOptions;