feat(parser): Add ButtonCardView (#834)

This commit is contained in:
jonz94
2024-12-12 20:31:14 +08:00
committed by GitHub
parent 13e796123b
commit eeaae6209f
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import NavigationEndpoint from './NavigationEndpoint.js';
import { YTNode } from '../helpers.js';
import type { RawNode } from '../index.js';
export default class ButtonCardView extends YTNode {
static type = 'ButtonCardView';
title: string;
icon_name: string;
on_tap_endpoint: NavigationEndpoint;
constructor(data: RawNode) {
super();
this.title = data.title;
this.icon_name = data.icon.sources[0].clientResource.imageName;
this.on_tap_endpoint = new NavigationEndpoint(data.rendererContext.commandContext.onTap);
}
}