import React, { memo } from 'react' import { StyleSheet } from 'react-native' import { SvgXml } from 'react-native-svg' import type { SortArrowProps } from './TableTypes' const ICON_SIZE = 16 // TODO(michael-adalo): improve this implementation to make it less hacky const SortIndicatorArrow = ({ direction, theme }: SortArrowProps) => { let xml = '' if (direction === 'asc') { xml = `` } else if (direction === 'desc') { xml = `` } else { throw new Error('Invalid direction') } const svgXmlProps = { xml, width: ICON_SIZE, height: ICON_SIZE, fill: theme.headerText.color, style: styles.icon, } return } const styles = StyleSheet.create({ icon: { width: ICON_SIZE, height: ICON_SIZE, marginLeft: 8, verticalAlign: 'middle', }, }) export default memo(SortIndicatorArrow)