chore: removing dead code and cleaning up UI

This commit is contained in:
2025-07-18 14:44:59 +01:00
parent 5a1f3bb75b
commit ec4e8b7e2a
8 changed files with 87 additions and 312 deletions

View File

@@ -1,52 +0,0 @@
import { invoke } from "@tauri-apps/api/core";
import { open } from "@tauri-apps/plugin-dialog";
import { createSignal } from "solid-js";
export function FolderPicker() {
const [selectedPath, setSelectedPath] = createSignal<string>("");
const handleFolderSelect = async () => {
try {
const selected = await open({
directory: true,
multiple: false,
});
if (selected) {
setSelectedPath(selected as string);
// Send the path to Rust
const response = await invoke("handle_selected_folder", {
path: selected,
});
console.log("DBG: ", response);
}
} catch (error) {
console.error("DBG: ", error);
}
};
return (
<div class="flex flex-col items-start gap-2">
<p class="text-sm text-neutral-700">
Select the folder where your screenshots are stored. We'll watch
this folder for any changes and process any new screenshots.
</p>
<div class="flex items-center gap-2">
<button
type="button"
onClick={handleFolderSelect}
class="bg-neutral-100 border border-neutral-300 rounded-md px-2 py-1"
>
Select folder
</button>
{selectedPath() && (
<div class="text-left max-w-md">
<p class="text-sm break-all">{selectedPath()}</p>
</div>
)}
</div>
</div>
);
}

View File

@@ -2,7 +2,7 @@ import { Component } from "solid-js";
import { base } from "../../network";
import { A } from "@solidjs/router";
export const Image: Component<{ ID: string }> = (props) => {
export const ImageComponent: Component<{ ID: string }> = (props) => {
return (
<A href={`/image/${props.ID}`}>
<img src={`${base}/image/${props.ID}`} />