"use client";
import { IconHistory, IconRefresh } from "@tabler/icons-react";
import { Badge } from "@kandev/ui/badge";
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
} from "@kandev/ui/dialog";
import { Kbd } from "@kandev/ui/kbd";
import { cn } from "@/lib/utils";
import {
useRecentTaskSwitcherController,
type RecentTaskSwitcherController,
} from "./recent-task-switcher-hooks";
import type { RecentTaskDisplayItem } from "./recent-task-switcher-model";
function TaskBadges({ item }: { item: RecentTaskDisplayItem }) {
return (
{item.statusBadge.label}
{item.repositoryPath && (
{item.repositoryPath}
)}
{item.workflowName && (
{item.workflowName}
)}
{item.workflowStepTitle && (
{item.workflowStepTitle}
)}
{item.isCurrent && (
Current
)}
);
}
function RecentTaskRow({
item,
selected,
onSelect,
onHover,
}: {
item: RecentTaskDisplayItem;
selected: boolean;
onSelect: () => void;
onHover: () => void;
}) {
return (
);
}
function EmptyState() {
return (
);
}
function RecentTaskList({
items,
selectedIndex,
setSelectedIndex,
selectItem,
}: Pick<
RecentTaskSwitcherController,
"items" | "selectedIndex" | "setSelectedIndex" | "selectItem"
>) {
if (items.length === 0) return ;
return (
{items.map((item, index) => (
selectItem(item)}
onHover={() => setSelectedIndex(index)}
/>
))}
);
}
function SwitcherFooter({
shortcutLabel,
reverseShortcutLabel,
}: {
shortcutLabel: string;
reverseShortcutLabel: string;
}) {
return (
{shortcutLabel} Next
{reverseShortcutLabel} Previous
);
}
function RecentTaskSwitcherDialog(props: RecentTaskSwitcherController) {
return (
);
}
export function RecentTaskSwitcher() {
return ;
}