Compare commits

..

No commits in common. "be19a391275a06207320e1d3a3b7320aedbc507d" and "cd999e5cdb8b03b409307e5e8e352dff373af8e8" have entirely different histories.

1 changed files with 12 additions and 11 deletions

View File

@ -1,6 +1,8 @@
import React from "react"; import React from "react";
import { asString } from "../helpers/value"; import { Pressable, Text, View } from "react-native";
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";
@ -23,16 +25,15 @@ 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 (
<StandardIndexCard <Pressable onPress={onPress}>
title={asString(a.point_name) || asString(a.name) || item.title} <View style={{ padding: 14, gap: 7 }}>
subtitle={subtitle || null} <View style={{ flexDirection: "row", gap: 10 }}>
onPress={onPress} <Text style={{ flex: 1, fontSize: 17, fontWeight: "600" }}>{asString(a.point_name) || asString(a.name) || item.title}</Text>
/> </View>
<Text>{asString(a.channel)}</Text>
<ChipList items={asStringArray(a.point_type).slice(0, 3)} />
</View>
</Pressable>
); );
} }