31 lines
879 B
TypeScript
31 lines
879 B
TypeScript
import React from "react";
|
|
import { StyleSheet, Text, View } from "react-native";
|
|
|
|
const greenChipTone = { bg: "#EEF7F1", border: "#D5E8DB", text: "#35664E" };
|
|
|
|
export function ChipList({ items }: { items: string[] }) {
|
|
if (!items.length) return null;
|
|
return (
|
|
<View style={styles.root}>
|
|
{items.map((item) => {
|
|
return (
|
|
<View key={item} style={[styles.chip, { backgroundColor: greenChipTone.bg, borderColor: greenChipTone.border }]}>
|
|
<Text style={[styles.text, { color: greenChipTone.text }]}>{item}</Text>
|
|
</View>
|
|
);
|
|
})}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
root: { flexDirection: "row", flexWrap: "wrap", gap: 8 },
|
|
chip: {
|
|
borderWidth: 1,
|
|
borderRadius: 999,
|
|
paddingHorizontal: 11,
|
|
paddingVertical: 7,
|
|
},
|
|
text: { fontSize: 13, lineHeight: 18, fontWeight: "600" },
|
|
});
|