The textbook example and the right solution. I testify as a former seaman and certified firefighter.What I did with that fire was buy time to break out the 5 gal foam can/s and the foam equipment to blanket the fuel spill to greatly reduce the re-ignition danger
Working on tankers, we knew water was used for cooling while foam was used for actual firefighting. Unless your foam lines or generator were down. Then it was up to your creativity and common sense.