Your IP : 216.73.216.86


Current Path : /var/www/homesaver/www/bitrix/js/ui/accessrights/v2/src/components/section/
Upload File :
Current File : /var/www/homesaver/www/bitrix/js/ui/accessrights/v2/src/components/section/icon.js

export const Icon = {
	name: 'Icon',
	inject: ['section'],
	computed: {
		iconBgColor(): string {
			if (this.section.sectionIcon.bgColor.startsWith('--'))
			{
				// css variable
				return `var(${this.section.sectionIcon.bgColor})`;
			}

			// we assume its hex
			return this.section.sectionIcon.bgColor;
		},
	},
	template: `
		<div v-if="section.sectionIcon" class="ui-access-rights-v2-section-header-icon" :style="{
			backgroundColor: iconBgColor,
		}">
			<div class="ui-icon-set" :class="'--' + section.sectionIcon.type"></div>
		</div>
	`,
};