1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { BrowserContext } from "https://esm.town/v/pomdtr/browser";
export default async function(ctx: BrowserContext) {
const resp = await fetch("https://api.iconify.design/collection?prefix=heroicons");
if (!resp.ok) {
throw new Error(await resp.text());
}
const { uncategorized: icons } = await resp.json() as { uncategorized: string[] };
const items = icons.filter(
(icon) => !icon.endsWith("-solid"),
).map(icon => ({
icon,
title: icon,
commands: [
{
title: "Copy Icon",
val: "pomdtr/copy_text",
params: {
text: icon,
},
},
],
}));
return {
type: "push",
page: {
type: "list",
items,
},
};
}