import { ModalRoot, ModalOverlay, ModalContent, } from '../../elements/ModalPrimitives' import { Box, HStack, VStack, Separator, SpanBox } from '../../elements/LayoutPrimitives' import { Button } from '../../elements/Button' import { StyledText } from '../../elements/StyledText' import { CrossIcon } from '../../elements/images/CrossIcon' import { CommentIcon } from '../../elements/images/CommentIcon' import { TrashIcon } from '../../elements/images/TrashIcon' import { styled, theme } from '../../tokens/stitches.config' import type { Highlight } from '../../../lib/networking/fragments/highlightFragment' import { HighlightView } from '../../patterns/HighlightView' import { useCallback, useState } from 'react' import { StyledTextArea } from '../../elements/StyledTextArea' import { ConfirmationModal } from '../../patterns/ConfirmationModal' import { AlignCenterHorizontalSimple, ArrowsInLineHorizontal, ArrowsOutLineHorizontal, Minus, Pen, Plus, Trash, X } from 'phosphor-react' import { AIcon } from '../../elements/images/AIcon' import { TickedRangeSlider } from '../../elements/TickedRangeSlider' import { UserPreferences } from '../../../lib/networking/queries/useGetUserPreferences' import { showSuccessToast } from '../../../lib/toastHelpers' type ReaderSettingsProps = { userPreferences?: UserPreferences articleActionHandler: (action: string, arg?: number) => void } const VerticalDivider = styled(SpanBox, { width: '1px', height: '100%', background: `${theme.colors.grayLine.toString()}`, }) export function ReaderSettings(props: ReaderSettingsProps): JSX.Element { const [marginWidth, setMarginWidth] = useState(props.userPreferences?.margin ?? 0) const [lineHeight, setLineHeight] = useState(props.userPreferences?.lineHeight ?? 150) return ( Margin: { setMarginWidth(value) props.articleActionHandler('setMarginWidth', value) }} /> Line Height: { setLineHeight(value) props.articleActionHandler('setLineHeight', value) }} /> ) }