import { isValidProjectRoot } from '@/lib/tauri-bridge';

export function isPlaceholderRoot(path: string | undefined): boolean {
  const trimmed = (path || '').trim();
  return trimmed === '' || trimmed === '.';
}

export async function isUsableProjectRoot(path: string): Promise<boolean> {
  if (isPlaceholderRoot(path)) return false;
  try {
    return await isValidProjectRoot(path);
  } catch {
    return false;
  }
}
