diff --git a/src/parser/classes/ButtonCardView.ts b/src/parser/classes/ButtonCardView.ts new file mode 100644 index 000000000..fe4b76d42 --- /dev/null +++ b/src/parser/classes/ButtonCardView.ts @@ -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); + } +} diff --git a/src/parser/nodes.ts b/src/parser/nodes.ts index a23778d1d..c24cc35d4 100644 --- a/src/parser/nodes.ts +++ b/src/parser/nodes.ts @@ -33,6 +33,7 @@ export { default as BadgeView } from './classes/BadgeView.js'; export { default as BrowseFeedActions } from './classes/BrowseFeedActions.js'; export { default as BrowserMediaSession } from './classes/BrowserMediaSession.js'; export { default as Button } from './classes/Button.js'; +export { default as ButtonCardView } from './classes/ButtonCardView.js'; export { default as ButtonView } from './classes/ButtonView.js'; export { default as C4TabbedHeader } from './classes/C4TabbedHeader.js'; export { default as CallToActionButton } from './classes/CallToActionButton.js';