import { type Component, For } from "solid-js";
import { ThemeToggle } from "../components/ThemeToggle";
import { store, restoreTask, deleteTaskPermanently, setMatrixScaleDays } from "@/store";
import { Trash2, Undo2, ArrowLeftRight, Hash } from "lucide-solid";
import { cn } from "@/lib/utils";
import { Button } from "@/components/ui/button";
import { toast } from "solid-sonner";
import { Select, SelectContent, SelectItem, SelectTrigger } from "@/components/ui/select";
import { pb } from "@/lib/pocketbase";
import { upsertTagDefinition, removeTagDefinition, renameTagDefinition } from "@/store";
import { createSignal } from "solid-js";
export const SettingsView: Component = () => {
return (
Appearance
Select your preferred color scheme.
{/* Matrix Configuration */}
Matrix Horizon
Adjust the time scale for your strategy grid.
Global Tags
Manage your global tag definitions and values.
a[0].localeCompare(b[0]))} fallback={
No specific tag definitions found.
}>
{([tagName, val]) => {
const [isEditingName, setIsEditingName] = createSignal(false);
const [tempName, setTempName] = createSignal(tagName);
const handleRename = () => {
if (tempName() && tempName() !== tagName) {
renameTagDefinition(tagName, tempName());
}
setIsEditingName(false);
};
return (
Trash
Items are permanently deleted after 7 days.
t.deletedAt)} fallback={
Trash is empty.
}>
{(task) => {
const daysLeft = Math.ceil(((task.deletedAt || 0) + (7 * 24 * 60 * 60 * 1000) - Date.now()) / (1000 * 60 * 60 * 24));
return (
{task.title || "Untitled"}
Expires in {Math.max(0, daysLeft)} days
);
}}
);
};