mirror of
https://github.com/Stef-00012/Zipline-Android-App.git
synced 2025-05-10 18:05:52 +02:00
22 lines
558 B
TypeScript
22 lines
558 B
TypeScript
import { Text, View, type ColorValue } from "react-native";
|
|
import { styles } from "@/styles/components/chartLegend";
|
|
|
|
interface Props {
|
|
data: Array<{
|
|
label: string;
|
|
color: ColorValue;
|
|
}>;
|
|
}
|
|
|
|
export default function ChartLegend({ data }: Props) {
|
|
return (
|
|
<View style={styles.mainLegendContainer}>
|
|
{data.map(({ label, color }) => (
|
|
<View key={label} style={styles.legendContainer}>
|
|
<View style={{ ...styles.legendColor, backgroundColor: color }} />
|
|
<Text style={styles.legendtText}>{label}</Text>
|
|
</View>
|
|
))}
|
|
</View>
|
|
);
|
|
}
|