import { ScrollView, Box, RenderComponentWithExample, Row, Display, CheckboxButton, Spacer, } from '@/design-system' import { useBoolean, useScreenOptions, useTheme, useTranslation } from '@/hooks' const RecursiveColorList = ({ data, parentKey = '', recursiveLevel = 0, }: { // eslint-disable-next-line @typescript-eslint/no-explicit-any data: Record parentKey?: string recursiveLevel?: number }) => { const sortedArray = Object.entries(data).sort(([keyA, valueA], [keyB, valueB]) => { const aIsString = typeof valueA === 'string' const bIsString = typeof valueB === 'string' if (aIsString && !bIsString) return -1 // `a` comes before `b` if (!aIsString && bIsString) return 1 // `b` comes before `a` return 0 // No change in order }) return sortedArray.map(([key, value]) => { const currentKey = parentKey ? `${parentKey}.${key}` : key if (typeof value === 'string') { // It's a color return ( } /> ) } else if (typeof value === 'object') { // It's a nested category return ( {currentKey} ) } else { return null } }) } export const ColorsScreen = (): JSX.Element => { const { t } = useTranslation() const [shouldDisplayAll, setShouldDisplayAll] = useBoolean(false) useScreenOptions({ title: t('navigation.screen_titles.colors'), }) const theme = useTheme() const colorsToRender = shouldDisplayAll ? theme.colors : { text: theme.colors.text, bg: theme.colors.bg, Base: theme.colors.Base, Error: theme.colors.Error, Warning: theme.colors.Warning, Success: theme.colors.Success, } return ( ) }