feat(web): rework context menus: add icons and reorder items (#8090)

This commit is contained in:
Ethan Margaillan 2024-03-21 19:39:33 +01:00 committed by GitHub
parent 1abb0bdae8
commit 8ed6ed4d2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 204 additions and 84 deletions

View file

@ -12,6 +12,7 @@ import {
unlinkOAuthAccount,
type UserResponseDto,
} from '@immich/sdk';
import { mdiCogRefreshOutline, mdiDatabaseRefreshOutline, mdiImageRefreshOutline } from '@mdi/js';
interface DownloadRequestOptions<T = unknown> {
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
@ -196,6 +197,16 @@ export const getAssetJobMessage = (job: AssetJobName) => {
return messages[job];
};
export const getAssetJobIcon = (job: AssetJobName) => {
const names: Record<AssetJobName, string> = {
[AssetJobName.RefreshMetadata]: mdiDatabaseRefreshOutline,
[AssetJobName.RegenerateThumbnail]: mdiImageRefreshOutline,
[AssetJobName.TranscodeVideo]: mdiCogRefreshOutline,
};
return names[job];
};
export const copyToClipboard = async (secret: string) => {
try {
await navigator.clipboard.writeText(secret);