diff --git a/src/renderer/components/button.ts b/src/renderer/components/button.ts new file mode 100644 index 0000000..fda59c8 --- /dev/null +++ b/src/renderer/components/button.ts @@ -0,0 +1,4 @@ + +export const SettingButton = (text: string, id?: string, type: string = 'secondary') => { + return `${text}`; +} \ No newline at end of file diff --git a/src/renderer/components/index.ts b/src/renderer/components/index.ts new file mode 100644 index 0000000..7fd2fe8 --- /dev/null +++ b/src/renderer/components/index.ts @@ -0,0 +1,5 @@ +export * from './list'; +export * from './item'; +export * from './button'; +export * from './switch'; +export * from './select'; diff --git a/src/renderer/components/item.ts b/src/renderer/components/item.ts new file mode 100644 index 0000000..2f054a0 --- /dev/null +++ b/src/renderer/components/item.ts @@ -0,0 +1,10 @@ + +export const SettingItem = (title: string, subtitle?: string, action?: string, id?: string, visible: boolean = true) => { + return ` +
+ ${title} + ${subtitle ? `${subtitle}` : ''} +
+ ${action ? `
${action}
` : ''} +
`; +} \ No newline at end of file diff --git a/src/renderer/components/list.ts b/src/renderer/components/list.ts new file mode 100644 index 0000000..af2d8ff --- /dev/null +++ b/src/renderer/components/list.ts @@ -0,0 +1,10 @@ + +export const SettingList = (items: string[], title?: string, isCollapsible: boolean = false, direction: string = 'column') => { + return ` + + + ${items.join('')} + + +`; +} \ No newline at end of file diff --git a/src/renderer/components/option.ts b/src/renderer/components/option.ts new file mode 100644 index 0000000..d134ba3 --- /dev/null +++ b/src/renderer/components/option.ts @@ -0,0 +1,4 @@ + +export const SettingOption = (text: string, value?: string, isSelected: boolean = false) => { + return `${text}`; +} \ No newline at end of file diff --git a/src/renderer/components/select.ts b/src/renderer/components/select.ts new file mode 100644 index 0000000..0c33332 --- /dev/null +++ b/src/renderer/components/select.ts @@ -0,0 +1,11 @@ +import { SettingOption } from "./option"; + +export const SettingSelect = (items: Array<{ text: string, value: string }>, configKey?: string, configValue?: any) => { + return ` +
+ ${items.map((e, i) => { + return SettingOption(e.text, e.value, (configKey && configValue ? configValue === e.value : i === 0)); + }).join('')} +
+
`; +} \ No newline at end of file diff --git a/src/renderer/components/switch.ts b/src/renderer/components/switch.ts new file mode 100644 index 0000000..1978a47 --- /dev/null +++ b/src/renderer/components/switch.ts @@ -0,0 +1,9 @@ + +export const SettingSwitch = (configKey?: string, isActive: boolean = false, extraData?: Record) => { + return ` `data-${key}="${extraData[key]}"`) : ''} + > +`; +} \ No newline at end of file diff --git a/src/renderer.ts b/src/renderer/index.ts similarity index 100% rename from src/renderer.ts rename to src/renderer/index.ts