import React, { useMemo } from "react"; import { View } from "react-native"; import { cn, useThemeColor } from "heroui-native"; import { ChevronForwardIcon, type NIcon, resolveIcon } from "../helpers/icons"; import { NPress } from "./NPress"; import { NText } from "./NText"; export interface NActionItemProps { name: string; description?: string; icon?: NIcon; showArrow?: boolean; feedback?: boolean; isDisabled?: boolean; className?: string; titleClassName?: string; descriptionClassName?: string; onPress?: () => void; onLongPress?: () => void; } export const NActionItem = React.memo( ({ name, description, icon, showArrow = true, feedback = false, isDisabled = false, className, titleClassName, descriptionClassName, onPress, onLongPress, }) => { const [mutedColor, foregroundColor] = useThemeColor(["muted", "foreground"]); const actionIcon = useMemo( () => resolveIcon(icon, { color: foregroundColor }), [icon, foregroundColor], ); return ( {actionIcon} {name} {description && ( {description} )} {showArrow && } ); }, ); NActionItem.displayName = "NActionItem";