import { computed } from 'vue'
import { generateProps } from '../helper/component-util'
import { componentScheme } from './component.scheme'

import './index.less'

export default {
  name: 'CipSvgIcon',
  props: generateProps(componentScheme),
  setup (props) {
    const className = computed(() => {
      return `#icon-${props.name}`
    })
    return () => <svg class={['cip-svg-icon']} aria-hidden={'true'}>
      <use xlinkHref={className.value}></use>
    </svg>
  }
}
