feat: Add flatrate billing model for editorial accounts
This commit is contained in:
1 parent
699580a6a0
commit
0b1ffdfdfc
39 files changed
+4900
-57
No files matched your search
@@ -49,40 +49,48 @@ function AlbumCard({
|
||||
};
|
||||
|
||||
return (
|
||||
<li className="album-card" data-granted={album.isGranted}>
|
||||
<div className="album-card-image-container">
|
||||
<li className={`flex flex-col bg-white border ${album.isGranted ? 'border-green-500 shadow-md ring-1 ring-green-500' : 'border-gray-200'} rounded-xl overflow-hidden transition-all duration-300 hover:shadow-lg`} data-granted={album.isGranted}>
|
||||
<div className="relative aspect-[3/2] bg-gray-100 overflow-hidden">
|
||||
{album.albumThumbnailAssetId ? (
|
||||
<Image
|
||||
className="album-card-image"
|
||||
className="w-full h-full object-cover transition-transform duration-500 hover:scale-105"
|
||||
alt={`Titelbild von ${album.albumName}`}
|
||||
height={120}
|
||||
height={200}
|
||||
src={`/api/assets/${encodeURIComponent(album.albumThumbnailAssetId)}/thumbnail?albumId=${encodeURIComponent(album.id)}`}
|
||||
width={160}
|
||||
width={300}
|
||||
/>
|
||||
) : (
|
||||
<div aria-label="Kein Albumcover verfügbar" className="album-card-placeholder" role="img">
|
||||
<div aria-label="Kein Albumcover verfügbar" className="w-full h-full flex items-center justify-center text-gray-400 text-xs uppercase tracking-widest" role="img">
|
||||
Kein Cover
|
||||
</div>
|
||||
)}
|
||||
{album.isGranted && (
|
||||
<div className="absolute top-2 right-2 bg-green-500 text-white text-xs font-bold px-2 py-1 rounded-full shadow-sm">
|
||||
Zugewiesen
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="album-card-body">
|
||||
<h2 className="album-card-name" id={`album-${album.id}`} title={album.albumName}>
|
||||
<div className="p-4 flex flex-col flex-grow">
|
||||
<h2 className="text-base font-bold text-gray-900 mb-1 truncate" id={`album-${album.id}`} title={album.albumName}>
|
||||
{album.albumName}
|
||||
</h2>
|
||||
<p className="album-card-count">{album.assetCount} Fotos</p>
|
||||
<p className={`album-card-status ${album.isGranted ? "album-card-status--granted" : ""}`}>
|
||||
{album.isGranted ? "Zugewiesen" : "Nicht zugewiesen"}
|
||||
</p>
|
||||
<form action={handleAction}>
|
||||
<input name="immichAlbumId" type="hidden" value={album.id} />
|
||||
<button
|
||||
type="submit"
|
||||
className={`album-card-action ${album.isGranted ? "album-card-action--revoke" : "album-card-action--grant"}`}
|
||||
disabled={isPending}
|
||||
>
|
||||
{isPending ? "Lädt..." : album.isGranted ? "Zuweisung aufheben" : "Album zuweisen"}
|
||||
</button>
|
||||
</form>
|
||||
<p className="text-sm text-gray-500 mb-4">{album.assetCount} Fotos</p>
|
||||
<div className="mt-auto">
|
||||
<form action={handleAction}>
|
||||
<input name="immichAlbumId" type="hidden" value={album.id} />
|
||||
<button
|
||||
type="submit"
|
||||
className={`w-full py-2 px-4 rounded-lg font-semibold text-sm transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-1 ${
|
||||
album.isGranted
|
||||
? "bg-red-50 text-red-600 hover:bg-red-100 focus:ring-red-500 border border-red-200"
|
||||
: "bg-gray-900 text-white hover:bg-gray-800 focus:ring-gray-900"
|
||||
}`}
|
||||
disabled={isPending}
|
||||
>
|
||||
{isPending ? "Wird verarbeitet..." : album.isGranted ? "Zuweisung aufheben" : "Album zuweisen"}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
@@ -109,7 +117,7 @@ export function AlbumGrid({ albums, editorialId, grantAction, revokeAction }: Al
|
||||
{filteredAlbums.length === 0 ? (
|
||||
<p>Keine Alben gefunden.</p>
|
||||
) : (
|
||||
<ul className="album-grid" aria-label="Zuweisbare Immich-Alben">
|
||||
<ul className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-6" aria-label="Zuweisbare Immich-Alben">
|
||||
{filteredAlbums.map((album) => (
|
||||
<AlbumCard
|
||||
key={album.id}
|
||||
|
||||
Reference in new issue
Block a user