mirror of
https://github.com/immich-app/immich.git
synced 2025-12-11 04:03:49 +09:00
Add web interface with admin functionality (#167)
This commit is contained in:
27
web/src/lib/components/shared/side-bar-button.svelte
Normal file
27
web/src/lib/components/shared/side-bar-button.svelte
Normal file
@@ -0,0 +1,27 @@
|
||||
<script lang="ts">
|
||||
export let title: string;
|
||||
export let logo: any;
|
||||
export let actionType: AdminSideBarSelection | AppSideBarSelection;
|
||||
export let isSelected: boolean;
|
||||
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import type { AdminSideBarSelection, AppSideBarSelection } from '../../models/admin-sidebar-selection';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
const onButtonClicked = () => {
|
||||
dispatch('selected', {
|
||||
actionType,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<div
|
||||
on:click={onButtonClicked}
|
||||
class={`flex gap-4 place-items-center pl-5 py-3 rounded-tr-xl rounded-br-xl hover:bg-gray-200 hover:text-immich-primary hover:cursor-pointer
|
||||
${isSelected && 'bg-immich-primary/10 text-immich-primary hover:bg-immich-primary/50'}
|
||||
`}
|
||||
>
|
||||
<svelte:component this={logo} size="24" />
|
||||
<p class="font-medium text-sm">{title}</p>
|
||||
</div>
|
||||
Reference in New Issue
Block a user