0xSparked's picture
Upload folder using huggingface_hub
db14b86
import {
archiveRestore,
arrowDownLeft,
arrowDownWideNarrow,
arrowRight,
arrowRightLeft,
arrowUpDown,
clipboardList,
cornerRightUp,
dices,
fileArchive,
folderClosed,
image,
laptop2,
panelRight,
penSquare,
pencilRuler,
pipette,
play,
refreshCcw,
save,
settings,
trash,
wand2,
webcam, // @ts-ignore
} from 'lucide-static';
const replaceIcon = (button: HTMLButtonElement, emoji: string[], svg: string) => {
if (!button?.textContent || !svg) return;
for (const e of emoji) {
if (button?.textContent?.includes(e)) {
button.innerHTML = svg
.replace(`width="24"`, `width="16"`)
.replace(`height="24"`, `height="16"`);
}
}
};
export default () => {
console.time('🀯 [svgIcon] replace');
for (const button of document.querySelectorAll('button')) {
replaceIcon(button, ['πŸ–ŒοΈ'], penSquare);
replaceIcon(button, ['πŸ—ƒοΈ'], fileArchive);
replaceIcon(button, ['πŸ–ΌοΈ'], pipette);
replaceIcon(button, ['🎨️'], image);
replaceIcon(button, ['πŸ“‚'], folderClosed);
replaceIcon(button, ['πŸ”„', 'πŸ”', '♻️'], refreshCcw);
replaceIcon(button, ['↙️'], arrowDownLeft);
replaceIcon(button, ['‴'], cornerRightUp);
replaceIcon(button, ['↕️'], arrowDownWideNarrow);
replaceIcon(button, ['πŸ—‘οΈ'], trash);
replaceIcon(button, ['πŸ“‹'], clipboardList);
replaceIcon(button, ['πŸ’Ύ'], save);
replaceIcon(button, ['🎲️'], dices);
replaceIcon(button, ['πŸͺ„'], wand2);
replaceIcon(button, ['βš™οΈ'], settings);
replaceIcon(button, ['➑️'], arrowRight);
replaceIcon(button, ['β‡…'], arrowUpDown);
replaceIcon(button, ['⇄'], arrowRightLeft);
replaceIcon(button, ['🎴'], panelRight);
replaceIcon(button, ['πŸŒ€'], archiveRestore);
replaceIcon(button, ['πŸ’₯'], play);
replaceIcon(button, ['πŸ“·'], webcam);
replaceIcon(button, ['πŸ“'], laptop2);
replaceIcon(button, ['πŸ“'], pencilRuler);
}
console.timeEnd('🀯 [svgIcon] replace');
};