import { O as useDrives, a7 as useDispatch } from "./index-DEuI3Aoa.js";
function useDriveById(driveId) {
  const drives = useDrives();
  const foundDrive = drives?.find((drive2) => drive2.header.id === driveId);
  const [drive, dispatch] = useDispatch(foundDrive);
  if (!foundDrive) {
    throw new Error(`Drive with id ${driveId} not found`);
  }
  return [drive, dispatch];
}
export {
  useDriveById as u
};
//# sourceMappingURL=drive-by-id-DG_S24DX.js.map
