import React, { useCallback } from 'react'; import UITideAtom, { UITideAtomProps } from './UITideAtom'; import TextRoleNucleon from './nucleons/TextRoleNucleon'; import { useNavigation } from '@react-navigation/core'; import { useColorRoles } from '../theme/colorSystem'; export type UINavTideMoleculeProps = Omit< UITideAtomProps, 'rightIconName' | 'onPress' | 'title' > & { description?: string; route: R; label: string; }; export default function UINavTideMolecule({ leftIconName, description, label, route, ...listProps }: UINavTideMoleculeProps) { const navigation = useNavigation(); const { surface } = useColorRoles(); const bottom = description ? () => ( {description} ) : null; return ( navigation.navigate(route), [navigation, route] )} bottom={bottom} leftIconName={leftIconName} rightIconName="arrow-right" /> ); }