import { Stack, useLocalSearchParams } from "expo-router";
import TaskListScreen from "../../components/TaskListScreen";
import type { TaskStatus } from "../../lib/types";

const TITLES: Record<string, string> = {
  inbox: "Inbox",
  next: "Next up",
  waiting: "Waiting for",
  scheduled: "Scheduled",
  someday: "Someday",
  done: "Done",
};

const HINTS: Record<string, string> = {
  inbox: "Inbox zero. Capture from the home screen.",
  next: "No next actions. Clarify your inbox.",
  waiting: "Not waiting on anyone.",
  scheduled: "Nothing scheduled.",
  someday: "No someday/maybe items.",
  done: "Nothing done yet.",
};

export default function ListByStatus() {
  const { status } = useLocalSearchParams<{ status: string }>();
  const st = (status in TITLES ? status : "inbox") as TaskStatus;
  return (
    <>
      <Stack.Screen options={{ title: TITLES[st] }} />
      <TaskListScreen status={st} capture={st === "inbox" || st === "next"} emptyHint={HINTS[st]} />
    </>
  );
}
