<commit_before>import React, { Component } from 'react'
import { withClient } from 'cozy-client'

import Icon from 'cozy-ui/react/Icon'
import AppLinker, { generateWebLink } from 'cozy-ui/react/AppLinker'
import palette from 'cozy-ui/stylus/settings/palette.json'

export class AddServiceTile extends Component {
  render() {
    const { label, client } = this.props
    const nativePath = '/discover/?type=konnector'
    const slug = 'store'
    const cozyURL = new URL(client.getStackClient().uri)

    return (
      <AppLinker
        slug={'store'}
        nativePath={nativePath}
        href={generateWebLink({
          cozyUrl: cozyURL.origin,
          slug: slug,
          nativePath: nativePath
        })}
      >
        {({ onClick, href }) => (
          <a onClick={onClick} href={href} className="item item--add-service">
            <div className="item-icon">
              <Icon icon="plus" size={16} color={palette['dodgerBlue']} />
            </div>
            <span className="item-title">{label}</span>
          </a>
        )}
      </AppLinker>
    )
  }
}

export default withClient(AddServiceTile)
<commit_msg>refactor: Transform class into a function<commit_after>import React from 'react'
import { withClient } from 'cozy-client'
import Icon from 'cozy-ui/react/Icon'
import AppLinker, { generateWebLink } from 'cozy-ui/react/AppLinker'
import palette from 'cozy-ui/stylus/settings/palette.json'

const AddServiceTile = ({ label, client }) => {
  const nativePath = '/discover/?type=konnector'
  const slug = 'store'
  const cozyURL = new URL(client.getStackClient().uri)

  return (
    <AppLinker
      slug={'store'}
      nativePath={nativePath}
      href={generateWebLink({
        cozyUrl: cozyURL.origin,
        slug: slug,
        nativePath: nativePath
      })}
    >
      {({ onClick, href }) => (
        <a onClick={onClick} href={href} className="item item--add-service">
          <div className="item-icon">
            <Icon icon="plus" size={16} color={palette['dodgerBlue']} />
          </div>
          <span className="item-title">{label}</span>
        </a>
      )}
    </AppLinker>
  )
}

export default withClient(AddServiceTile)

{'fraction_non_alphanumeric': 0.13992707383773928, 'fraction_numerical': 0.0018231540565177757, 'mean_word_length': 2.70777027027027, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4506590', 'n_tokens_mistral': 696, 'n_tokens_neox': 676, 'n_words': 146}