Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 16 additions & 56 deletions components/report/CardItem.tsx
Original file line number Diff line number Diff line change
@@ -1,52 +1,21 @@
import Ionicons from '@expo/vector-icons/Ionicons';
import { Pressable, Text, View } from 'react-native';
import Ionicons from '@expo/vector-icons/Ionicons'
import { Pressable, Text, View } from 'react-native'

type topic = {
id: number;
text: string;
};
id: number,
text: string
}
type Props = {
icon: any;
typeCard: 'positive' | 'negative' | 'recomendation';
topics: topic[];
handlePress: () => void;
};
icon: any,
typeCard: 'positive' | 'negative' | 'recomendation',
topics: topic[]
handlePress: ()=> void
}

export const CardItem = ({ icon, typeCard, topics, handlePress }: Props) => {
return (
<View className="px-10 py-8 border border-primary rounded-2xl justify-center gap-6">
<View className="flex-row items-center justify-between">
<Ionicons name={icon} size={28} color="#C34342" />
{typeCard === 'positive' && (
<>
<Text className="text-xl text-primary font-semibold">
Pontos positivos
</Text>
<View className="w-5 h-5 rounded-full bg-emerald-500"></View>
</>
)}
{typeCard === 'negative' && (
<>
<Text className="text-xl text-primary font-semibold">
Pontos negativos
</Text>
<View className="w-5 h-5 rounded-full bg-rose-600"></View>
</>
)}
{typeCard === 'recomendation' && (
<>
<Text className="text-xl text-primary font-semibold">
Recomendações
</Text>
<View className="w-5 h-5 rounded-full bg-cyan-400"></View>
</>
)}
</View>

{topics.map((item) => (
<View
key={item.id}
className="flex-row items-center justify-start gap-4 mb-1"
export const CardItem = ({icon, typeCard, topics, handlePress}: Props)=> {
return(
<View
className="px-10 py-8 border border-primary rounded-2xl justify-center gap-6"
>
<View className="flex-row items-center justify-between">
<Ionicons name={icon} size={28} color="#C34342" />
Expand Down Expand Up @@ -84,14 +53,5 @@ export const CardItem = ({ icon, typeCard, topics, handlePress }: Props) => {
<Ionicons name={'arrow-forward'} size={20} color="#FFFFFF" />
</Pressable>
</View>
))}
<Pressable
className="flex-row items-center bg-primary justify-center rounded-xl py-3 gap-3"
onPress={handlePress}
>
<Text className="text-light font-semibold">Ver Sugestões</Text>
<Ionicons name={'arrow-forward'} size={20} color="#FFFFFF" />
</Pressable>
</View>
);
};
)
}
Loading