import { findFileByPath, mockWorkspaceFiles } from "@/pages/workspace/mock-data";
import { useWorkspaceUiStore } from "@/lib/store/workspace-ui-store";

export function WorkspacePage() {
  const activeFilePath = useWorkspaceUiStore((s) => s.activeFilePath);
  const activeFile = findFileByPath(mockWorkspaceFiles, activeFilePath);

  return (
    <div className="flex h-full flex-col bg-background text-foreground">
      <header className="border-b border-border px-4 py-2">
        <h1 className="text-sm font-semibold">Codespace Workspace</h1>
      </header>
      <div className="flex-1 overflow-auto p-4">
        <p className="text-sm text-muted-foreground">
          Active file: <code className="text-foreground">{activeFilePath}</code>
        </p>
        <p className="mt-2 text-sm text-muted-foreground">
          Mock file match:{" "}
          <code className="text-foreground">
            {activeFile
              ? `${activeFile.name} (${activeFile.language ?? activeFile.kind})`
              : "not found"}
          </code>
        </p>
      </div>
    </div>
  );
}
