mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
43 lines
936 B
TypeScript
43 lines
936 B
TypeScript
import { ElementFromHtml } from '@/plugins/utils/renderer';
|
|
|
|
import { t } from '@/i18n';
|
|
|
|
import { Popup } from '../element';
|
|
import { createStatus } from '../ui/status';
|
|
|
|
import IconOff from '../icons/off.svg?raw';
|
|
|
|
export type GuestPopupProps = {
|
|
onItemClick: (id: string) => void;
|
|
};
|
|
export const createGuestPopup = (props: GuestPopupProps) => {
|
|
const status = createStatus();
|
|
status.setStatus('guest');
|
|
|
|
const result = Popup({
|
|
data: [
|
|
{
|
|
type: 'custom',
|
|
element: status.element,
|
|
},
|
|
{
|
|
type: 'divider',
|
|
},
|
|
{
|
|
type: 'item',
|
|
id: 'music-together-disconnect',
|
|
icon: ElementFromHtml(IconOff),
|
|
text: t('plugins.music-together.menu.disconnect'),
|
|
onClick: () => props.onItemClick('music-together-disconnect'),
|
|
},
|
|
],
|
|
anchorAt: 'bottom-right',
|
|
popupAt: 'top-right',
|
|
});
|
|
|
|
return {
|
|
...status,
|
|
...result,
|
|
};
|
|
};
|