<script>
import { Icon } from 'ant-design-vue'
function getTheme(t) {
  switch (t) {
    case 'outline':
      return 'outlined'
    case 'fill':
      return 'filled'
    case 'twotone':
      return 'twoTone'
    default:
      return t
  }
}

export { getTheme }

/**
 * 与AIcon相同，theme支持fill/filled两种写法
 * @displayName SdIcon 图标
 */
export default {
  name: 'SdIcon',
  functional: true,
  render(h, ctx) {
    ctx.data.attrs.theme = getTheme(ctx.data.attrs.theme)
    return h(Icon, ctx.data, ctx.children)
  },
}
</script>

<docs>
```vue
<template>
  <div>
    <sd-icon type='sd-audio-circle' theme='fill'/>
    <sd-icon type='sd-audio-circle' theme='filled'/>
  </div>
</template>
```
</docs>
