mirror of
https://github.com/immich-app/immich.git
synced 2026-04-25 02:19:58 -04:00
20 lines
786 B
TypeScript
20 lines
786 B
TypeScript
import type { ActionItem } from '@immich/ui';
|
|
import { mdiCast, mdiCastConnected } from '@mdi/js';
|
|
import type { MessageFormatter } from 'svelte-i18n';
|
|
import { CastDestinationType, castManager } from '$lib/managers/cast-manager.svelte';
|
|
import { GCastDestination } from '$lib/utils/cast/gcast-destination.svelte';
|
|
|
|
export const getGlobalActions = ($t: MessageFormatter) => {
|
|
const Cast: ActionItem = {
|
|
title: $t('cast'),
|
|
icon: castManager.isCasting ? mdiCastConnected : mdiCast,
|
|
color: castManager.isCasting ? 'primary' : 'secondary',
|
|
$if: () =>
|
|
castManager.availableDestinations.length > 0 &&
|
|
castManager.availableDestinations[0].type === CastDestinationType.GCAST,
|
|
onAction: () => void GCastDestination.showCastDialog(),
|
|
};
|
|
|
|
return { Cast };
|
|
};
|