Compare commits
2 Commits
cd999e5cdb
...
be19a39127
| Author | SHA1 | Date |
|---|---|---|
|
|
be19a39127 | |
|
|
aee5aacec0 |
|
|
@ -1,8 +1,6 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Pressable, Text, View } from "react-native";
|
import { asString } from "../helpers/value";
|
||||||
import { asString, asStringArray } from "../helpers/value";
|
|
||||||
import { CollectionScaffold } from "../shared/CollectionScaffold";
|
import { CollectionScaffold } from "../shared/CollectionScaffold";
|
||||||
import { ChipList } from "../shared/ChipList";
|
|
||||||
import { StandardIndexCard } from "../shared/StandardIndexCard";
|
import { StandardIndexCard } from "../shared/StandardIndexCard";
|
||||||
import type { CollectionItemRendererProps, CollectionRendererProps } from "../../types/renderer.types";
|
import type { CollectionItemRendererProps, CollectionRendererProps } from "../../types/renderer.types";
|
||||||
|
|
||||||
|
|
@ -25,15 +23,16 @@ export function AcuPointIndexCardRenderer({ item, onPress }: CollectionItemRende
|
||||||
}
|
}
|
||||||
export function AcuPointCardRenderer({ item, onPress }: CollectionItemRendererProps) {
|
export function AcuPointCardRenderer({ item, onPress }: CollectionItemRendererProps) {
|
||||||
const a = item.attributes;
|
const a = item.attributes;
|
||||||
|
const subtitle =
|
||||||
|
asString(a.pt_meaning) ||
|
||||||
|
asString(a.channel) ||
|
||||||
|
[asString(a.alt_name_1), asString(a.alt_name_2)].filter(Boolean).join(" · ");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Pressable onPress={onPress}>
|
<StandardIndexCard
|
||||||
<View style={{ padding: 14, gap: 7 }}>
|
title={asString(a.point_name) || asString(a.name) || item.title}
|
||||||
<View style={{ flexDirection: "row", gap: 10 }}>
|
subtitle={subtitle || null}
|
||||||
<Text style={{ flex: 1, fontSize: 17, fontWeight: "600" }}>{asString(a.point_name) || asString(a.name) || item.title}</Text>
|
onPress={onPress}
|
||||||
</View>
|
/>
|
||||||
<Text>{asString(a.channel)}</Text>
|
|
||||||
<ChipList items={asStringArray(a.point_type).slice(0, 3)} />
|
|
||||||
</View>
|
|
||||||
</Pressable>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue