export function valToListItem(val) {
return {
title: `${val.author.username}/${val.name}`,
icon: "command-line",
commands: [
{
title: "Open",
val: "pomdtr/open_url",
params: {
url: `https://www.val.town/v/${val.author.username}/${val.name}`,
replace: true,
},
},
{
title: "Open in Full Screen",
val: "pomdtr/open_url",
params: {
url: `https://www.val.town/embed/${val.author.username}/${val.name}`,
replace: true,
},
},
{
title: "Copy Http Endpoint",
val: "pomdtr/copy_text",
params: {
text: `http://${val.author.username}-${val.name}.web.val.run`,
},
},
{
title: "Copy Slug",
val: "pomdtr/copy_text",
params: {
text: `${val.author.username}/${val.name}`,
},
},
{
title: "View References",
val: "pomdtr/search_val_references",
params: {
author: val.author.username,
name: val.name,
},
},
],
};
}