code: def test_component_decorator_set_it_as_component():
      @component
      class MockComponent:
          @component.output_types(value=int)
          def run(self, value: int):
              return {"value": 1}
  
          def to_dict(self):
              return {}
  
          @classmethod
          def from_dict(cls, data):
              return cls()
  
      comp = MockComponent()
      assert isinstance(comp, Component)
  
file_path: haystack/test/core/component/test_component.py
imports: import typing
  from typing import Any, Optional
  import pytest
  from haystack.core.component import component
  from haystack.core.errors import ComponentError
  from haystack.core.component import InputSocket, OutputSocket, Component
label_desc: Use image node_id 8 for calling a global function with example usage: test_component_decorator_set_it_as_component() and returns: dict, dict, cls