2026-01-02 13:41:09 +00:00
|
|
|
// Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
|
2023-06-01 13:21:16 +00:00
|
|
|
|
|
|
|
|
import { i18n } from '#shared/i18n.ts'
|
2024-05-17 13:31:19 +00:00
|
|
|
|
2023-06-01 13:21:16 +00:00
|
|
|
import { usePrivateIcon } from './usePrivateIcon.ts'
|
|
|
|
|
|
2024-05-17 13:31:19 +00:00
|
|
|
import type { Props } from './CommonIcon.vue'
|
|
|
|
|
|
2023-06-01 13:21:16 +00:00
|
|
|
export const useRawHTMLIcon = (props: Props & { class?: string }) => {
|
|
|
|
|
const { iconClass, finalSize } = usePrivateIcon({ size: 'medium', ...props })
|
|
|
|
|
const html = String.raw
|
|
|
|
|
|
|
|
|
|
return html`
|
|
|
|
|
<svg
|
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
|
class="icon ${iconClass.value} ${props.class || ''} fill-current"
|
2025-11-28 09:27:06 +00:00
|
|
|
width=${finalSize.value.width}
|
|
|
|
|
height=${finalSize.value.height}
|
2025-06-11 17:45:28 +00:00
|
|
|
${!props.decorative && `aria-label=${i18n.t(props.label || props.name) || ''}`}
|
2023-06-01 13:21:16 +00:00
|
|
|
${(props.decorative && 'aria-hidden="true"') || ''}
|
|
|
|
|
>
|
|
|
|
|
<use href="#icon-${props.name}" />
|
|
|
|
|
</svg>
|
|
|
|
|
`
|
|
|
|
|
}
|