Gamma-ray bursts from delayed collapse on neutron stars to quark matter stars