mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
21 lines
516 B
TypeScript
21 lines
516 B
TypeScript
import type { Action } from 'svelte/action';
|
|
import type { Props } from 'tippy.js';
|
|
import tippy from 'tippy.js';
|
|
|
|
export const tooltip: Action<HTMLElement, Partial<Props>> = (node, config) => {
|
|
const instance = tippy(node, config);
|
|
|
|
return {
|
|
update({ content }) {
|
|
if (content !== instance.props.content) {
|
|
instance.setProps({
|
|
content
|
|
});
|
|
}
|
|
},
|
|
destroy() {
|
|
instance.destroy();
|
|
}
|
|
};
|
|
};
|