Repository: ViewComponent/view_component (Ruby)

Issue:
Add Rails url helpers to Previews
## Feature request
Add Rails Url helpers to previews, for instance, if `resources :items` is defined in `routes.rb`, I may want to use `items_path` in the component preview method

### Motivation
I have personally come across the need to use these url helpers inside of the preview file, for example 

```
class LinkComponentPreview < ViewComponent::Preview
 def items_link_component
    render(LinkComponent.new(url: items_path))
  end
end
 ```
  Currently, when I try this I get this error 
  
  ```
  undefined local variable or method `items_path' for #<LinkComponentPreview:0x00000001113d7770>
  ```

<!-- What would you like to do with this feature? Can you provide
context or references to similar behavior in other libraries? -->
A similar way to achieve this is by using the preview template which will have the URL helpers loaded but that seems like overkill just to get access to a helper 



Discussion:

Patch:
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 578c4145e..b54c37412 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -18,6 +18,10 @@ nav_order: 5
 
     *Pasha Kalashnikov*
 
+* Add URL helpers to previews
+
+    *Reegan Viljoen*
+
 ## 3.1.0
 
 * Check `defined?(Rails) && Rails.application` before using `ViewComponent::Base.config.view_component_path`.
diff --git a/lib/view_component/preview.rb b/lib/view_component/preview.rb
index 0af154413..e80087404 100644
--- a/lib/view_component/preview.rb
+++ b/lib/view_component/preview.rb
@@ -4,6 +4,7 @@
 
 module ViewComponent # :nodoc:
   class Preview
+    include Rails.application.routes.url_helpers
     include ActionView::Helpers::TagHelper
     include ActionView::Helpers::AssetTagHelper
     extend ActiveSupport::DescendantsTracker


Test patch:
diff --git a/test/sandbox/app/components/url_helper_component.html.erb b/test/sandbox/app/components/url_helper_component.html.erb
new file mode 100644
index 000000000..8395fca03
--- /dev/null
+++ b/test/sandbox/app/components/url_helper_component.html.erb
@@ -0,0 +1,1 @@
+<a href="<%= @url %>" target="_blank">root</a>
diff --git a/test/sandbox/app/components/url_helper_component.rb b/test/sandbox/app/components/url_helper_component.rb
new file mode 100644
index 000000000..bc9ed2d43
--- /dev/null
+++ b/test/sandbox/app/components/url_helper_component.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class UrlHelperComponent < ViewComponent::Base
+  def initialize(url: root_path)
+    @url = url
+  end
+end
diff --git a/test/sandbox/test/components/previews/url_helper_component_preview.rb b/test/sandbox/test/components/previews/url_helper_component_preview.rb
new file mode 100644
index 000000000..4b69f98a8
--- /dev/null
+++ b/test/sandbox/test/components/previews/url_helper_component_preview.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class UrlHelperComponentPreview < ViewComponent::Preview
+  def default
+    render(UrlHelperComponent.new(url: root_path))
+  end
+end
diff --git a/test/sandbox/test/components/render_preview_test.rb b/test/sandbox/test/components/render_preview_test.rb
index f798ac9d1..dc5a00900 100644
--- a/test/sandbox/test/components/render_preview_test.rb
+++ b/test/sandbox/test/components/render_preview_test.rb
@@ -12,4 +12,10 @@ def test_render_preview_from_class
 
     assert_selector("div", text: "hello,world!")
   end
+
+  def test_render_preview_with_url_helper
+    render_preview(:default, from: UrlHelperComponentPreview)
+
+    assert_selector("a[href='/']", text: "root")
+  end
 end