import { Text } from "@/components/common/Text"; import { tc } from "@/utils/textTools"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { TouchableOpacity, View, type ViewProps } from "react-native"; interface Props extends ViewProps { text?: string | null; characterLimit?: number; } export const OverviewText: React.FC = ({ text, characterLimit = 100, ...props }) => { const [limit, setLimit] = useState(characterLimit); const { t } = useTranslation(); if (!text) return null; return ( {t("item_card.overview")} setLimit((prev) => prev === characterLimit ? text.length : characterLimit, ) } > {tc(text, limit)} {text.length > characterLimit && ( {limit === characterLimit ? t("item_card.show_more") : t("item_card.show_less")} )} ); };