`;
const d = this.data;
const lc = this.filter.toLowerCase();
// Detail mode: single GetYogaResponse
if (
'description' in d &&
typeof (d as GetYogaResponse).description === 'string'
) {
const yoga = d as GetYogaResponse;
return html`
${this.renderDetailCard(yoga)}
`;
}
// Detail-array mode: { yogas: Array } where items have description
if ('yogas' in d && Array.isArray((d as { yogas: unknown[] }).yogas)) {
const allYogas = (
d as { yogas: Array }
).yogas;
const isDetailArray = allYogas.length > 0 && 'description' in allYogas[0];
if (isDetailArray) {
const detailYogas = allYogas as GetYogaResponse[];
const filtered = lc
? detailYogas.filter((y) => y.name.toLowerCase().includes(lc))
: detailYogas;
const total = (d as ListYogasResponse).total;
return html`
Yoga catalog
${
total !== undefined
? html`${total} total`
: nothing
}