import React from 'react' import { TouchableOpacity } from 'react-native'; import { useTheme } from 'styled-components/native'; import { OText } from '../shared'; export const ExtraOptions = (props : any) => { const { options, setSelectedOpt, scrollViewRef, optionLayout, editionsLayoutY, styles, selOpt } = props const theme = useTheme() return ( <> {options.map(({ id, name, respect_to, suboptions }: any) => ( {respect_to == null && suboptions?.length > 0 && ( { setSelectedOpt(id) scrollViewRef?.current?.scrollTo && scrollViewRef.current.scrollTo({ y: optionLayout[`id:${id}`]?.y + editionsLayoutY - 50, animated: true }) }} style={[ styles.extraItem, { borderBottomColor: selOpt == id ? theme.colors.textNormal : theme.colors.backgroundPage, }, ]}> {name} )} ))} ) }