Files
custum-hyprpanel/modules/menus/media/components/mediainfo.js
2024-06-30 16:46:09 -07:00

52 lines
1.3 KiB
JavaScript

const MediaInfo = (curPlayer) => {
return Widget.Box({
class_name: "media-indicator-current-media-info",
hpack: "center",
hexpand: true,
vertical: true,
children: [
Widget.Box({
class_name: "media-indicator-current-song-name",
hpack: "center",
children: [
Widget.Label({
truncate: "end",
max_width_chars: 21,
wrap: true,
class_name: "media-indicator-current-song-name-label",
label: curPlayer["track-title"],
}),
],
}),
Widget.Box({
class_name: "media-indicator-current-song-author",
hpack: "center",
children: [
Widget.Label({
truncate: "end",
wrap: true,
max_width_chars: 25,
class_name: "media-indicator-current-song-author-label",
label: curPlayer["track-artists"].join(", "),
}),
],
}),
Widget.Box({
class_name: "media-indicator-current-song-album",
hpack: "center",
children: [
Widget.Label({
truncate: "end",
wrap: true,
max_width_chars: 25,
class_name: "media-indicator-current-song-album-label",
label: curPlayer["track-album"],
}),
],
}),
],
});
};
export { MediaInfo };