feat: add SimpleCardContent

Related: #129
This commit is contained in:
LuanRT
2022-08-04 02:16:12 -03:00
parent a788c9c80f
commit 3ff3d3c633
2 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import Text from './misc/Text';
import Thumbnail from './misc/Thumbnail';
import NavigationEndpoint from './NavigationEndpoint';
import { YTNode } from '../helpers';
class SimpleCardContent extends YTNode {
static type = 'SimpleCardContent';
image: Thumbnail[];
title: Text;
display_domain: Text;
show_link_icon: boolean;
call_to_action: Text;
endpoint: NavigationEndpoint;
constructor(data: any) {
super();
this.image = Thumbnail.fromResponse(data.image);
this.title = new Text(data.title);
this.display_domain = new Text(data.displayDomain);
this.show_link_icon = data.showLinkIcon;
this.call_to_action = data.callToAction;
this.endpoint = new NavigationEndpoint(data.command);
}
}
export default SimpleCardContent;