import React, { ComponentProps } from 'react' import { ActivityIndicator as NativeActivityIndicator } from 'react-native' import { useDripsyTheme } from '../use-dripsy-theme' import { DripsyFinalTheme } from '../declarations' import { useSx } from '../use-sx' import { SxProp } from '../css/types' type Props = Omit, 'color'> & { color?: (string & {}) | keyof DripsyFinalTheme['colors'] } function Indicator(props: Props & { sx?: SxProp }) { const { colors } = useDripsyTheme().theme const sx = useSx() let { color } = props if (typeof color === 'string' && colors?.[color]) { color = colors[color] as string } return ( ) } export const ActivityIndicator = Indicator