fix(InfoPanelContainer): Use new attributed text prop

+ And update other related nodes.
This commit is contained in:
Luan
2024-06-07 14:15:44 -03:00
parent 15f3b5fdba
commit 5cdb9e1e2f
3 changed files with 12 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
import { YTNode } from '../helpers.js';
import type { RawNode } from '../index.js';
import type { AttributedText } from './misc/Text.js';
import Text from './misc/Text.js';
import Thumbnail from './misc/Thumbnail.js';
import NavigationEndpoint from './NavigationEndpoint.js';
@@ -9,7 +10,7 @@ export default class InfoPanelContent extends YTNode {
title: Text;
source: Text;
paragraphs: Text[];
attributed_paragraphs: Text[];
thumbnail: Thumbnail[];
source_endpoint: NavigationEndpoint;
truncate_paragraphs: boolean;
@@ -20,7 +21,7 @@ export default class InfoPanelContent extends YTNode {
super();
this.title = new Text(data.title);
this.source = new Text(data.source);
this.paragraphs = data.paragraphs.map((p: RawNode) => new Text(p));
this.attributed_paragraphs = data.attributedParagraphs.map((p: AttributedText) => Text.fromAttributed(p));
this.thumbnail = Thumbnail.fromResponse(data.thumbnail);
this.source_endpoint = new NavigationEndpoint(data.sourceEndpoint);
this.truncate_paragraphs = !!data.truncateParagraphs;