feat(points): prioritize alt names in AcuPointCardRenderer and support ct0025 in MeridianPointsDetailRenderer
This commit is contained in:
parent
24838a68ee
commit
ce7d94ac10
|
|
@ -23,10 +23,11 @@ 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 altNames = [asString(a.alt_name_1), asString(a.alt_name_2)].filter(Boolean).join(" · ");
|
||||||
const subtitle =
|
const subtitle =
|
||||||
|
altNames ||
|
||||||
asString(a.pt_meaning) ||
|
asString(a.pt_meaning) ||
|
||||||
asString(a.channel) ||
|
asString(a.channel);
|
||||||
[asString(a.alt_name_1), asString(a.alt_name_2)].filter(Boolean).join(" · ");
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StandardIndexCard
|
<StandardIndexCard
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,18 @@ export function MeridianPointsDetailRenderer({
|
||||||
const totalCount = asNumber(data.content_count) || rawPoints.length;
|
const totalCount = asNumber(data.content_count) || rawPoints.length;
|
||||||
const countLabel = asString(data.content_label) || "points";
|
const countLabel = asString(data.content_label) || "points";
|
||||||
|
|
||||||
|
const targetTemplateCode = useMemo(() => {
|
||||||
|
for (const ref of rawPoints) {
|
||||||
|
if (ref.target?.template_code) {
|
||||||
|
return ref.target.template_code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "m0001_ct0003";
|
||||||
|
}, [rawPoints]);
|
||||||
|
|
||||||
const { data: pointsData } = useModuleTemplateContentDetailsQuery({
|
const { data: pointsData } = useModuleTemplateContentDetailsQuery({
|
||||||
module_code: moduleCode || "m0001",
|
module_code: moduleCode || "m0001",
|
||||||
template_code: "m0001_ct0003",
|
template_code: targetTemplateCode,
|
||||||
});
|
});
|
||||||
|
|
||||||
const detailsMap = useMemo(() => {
|
const detailsMap = useMemo(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue