mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
38 lines
1.1 KiB
Svelte
38 lines
1.1 KiB
Svelte
<script>
|
|
export let action = undefined;
|
|
// export let type = undefined;
|
|
// export let icon = undefined;
|
|
// export let content = undefined;
|
|
|
|
// import { onMount } from 'svelte';
|
|
import { cx } from '../../../lib';
|
|
import AppSwitcher20 from 'carbon-icons-svelte/lib/AppSwitcher20';
|
|
import Icon from '../../Icon/Icon.svelte';
|
|
|
|
console.log(action);
|
|
|
|
$: switcherIconProps =
|
|
action === 'switcher'
|
|
? (switcherIconProps = [
|
|
{
|
|
class: undefined,
|
|
skeleton: false,
|
|
render: AppSwitcher20,
|
|
title: 'Switcher',
|
|
tabIndex: 0,
|
|
focusable: false,
|
|
style: undefined
|
|
}
|
|
])
|
|
: (switcherIconProps = []);
|
|
</script>
|
|
|
|
{#if action === 'switcher'}
|
|
<button aria-label="Notifications" class={cx('--header__action')} type="button">
|
|
<Icon {...switcherIconProps} render={switcherIconProps[0].render} />
|
|
</button>
|
|
{:else}
|
|
<!-- <button aria-label="Notifications" class={cx('--header__action')} type="button">
|
|
<Icon {...icon} render={icon[0].render} />
|
|
</button> -->
|
|
{/if}
|