Both are important, imo. Writing good commits is useful for “showing your work” and breaking things down into steps. For example if I need to refactor a component when building a new feature, then I do it in a separate commit. Makes it easy to spin out a separate PR if necessary, and helps a reader understand why the refactor was necessary by looking at the next commit diff.
You can still write “fix” and “wip” commits locally, as long as you rebase them before you push your branch.