1 parent
1b986a831f
commit
9bd314f626
8 files changed
+25
-23
No files matched your search
@@ -55,7 +55,7 @@ export default function AlbumCreateDialog({ onSubmit, assetIds }: IProps) {
|
|||||||
return (
|
return (
|
||||||
<Dialog open={open} onOpenChange={setOpen}>
|
<Dialog open={open} onOpenChange={setOpen}>
|
||||||
<DialogTrigger asChild>
|
<DialogTrigger asChild>
|
||||||
<Button>Create Album</Button>
|
<Button size={"sm"}>Create Album</Button>
|
||||||
</DialogTrigger>
|
</DialogTrigger>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export default function AlbumSelectorDialog({ onSelected }: IProps) {
|
|||||||
return (
|
return (
|
||||||
<Dialog open={open} onOpenChange={setOpen}>
|
<Dialog open={open} onOpenChange={setOpen}>
|
||||||
<DialogTrigger asChild>
|
<DialogTrigger asChild>
|
||||||
<Button>Select Album</Button>
|
<Button size={"sm"}>Select Album</Button>
|
||||||
</DialogTrigger>
|
</DialogTrigger>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
|
|||||||
@@ -125,22 +125,21 @@ export default function AlbumImages({ album }: AlbumImagesProps) {
|
|||||||
index={index}
|
index={index}
|
||||||
close={() => setIndex(-1)}
|
close={() => setIndex(-1)}
|
||||||
/>
|
/>
|
||||||
<div className="w-full grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-2 p-2">
|
<div className="w-full grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-2 p-2">
|
||||||
{images.map((image) => (
|
{images.map((image) => (
|
||||||
<div
|
<div
|
||||||
key={image.id}
|
key={image.id}
|
||||||
className="w-full h-[200px] overflow-hidden relative"
|
className="w-full h-[180px] overflow-hidden relative"
|
||||||
>
|
>
|
||||||
<LazyImage
|
<LazyImage
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
key={image.id}
|
key={image.id}
|
||||||
src={image.original}
|
src={image.original}
|
||||||
alt={image.originalFileName}
|
alt={image.originalFileName}
|
||||||
className='overflow-hidden'
|
className='overflow-hidden max-h-[180px] max-w-[180px] min-h-[180px] min-w-[180px]'
|
||||||
style={{
|
style={{
|
||||||
objectPosition: 'center',
|
objectPosition: 'center',
|
||||||
objectFit: 'cover',
|
objectFit: 'cover'
|
||||||
height: '100%',
|
|
||||||
}}
|
}}
|
||||||
onClick={() => handleClick(images.indexOf(image))}
|
onClick={() => handleClick(images.indexOf(image))}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export default function AlbumPeople({ album, onSelect }: AlbumPeopleProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="overflow-y-auto min-w-[200px] sticky top-0 py-4 max-h-[calc(100vh-60px)] min-h-[calc(100vh-60px)] dark:bg-zinc-900 bg-gray-200 flex flex-col gap-2 px-2">
|
<div className="overflow-y-auto min-w-[200px] sticky top-0 py-4 max-h-[calc(100vh-60px)] min-h-[calc(100vh-60px)] border-r border-gray-200 dark:border-zinc-800 flex flex-col gap-2 px-2">
|
||||||
|
|
||||||
{selectedPerson && (
|
{selectedPerson && (
|
||||||
<div className='flex flex-col gap-2 bg-white dark:bg-zinc-900 p-2 rounded-md'>
|
<div className='flex flex-col gap-2 bg-white dark:bg-zinc-900 p-2 rounded-md'>
|
||||||
@@ -157,7 +157,7 @@ export default function AlbumPeople({ album, onSelect }: AlbumPeopleProps) {
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{selectedPeople.length > 0 && (
|
{selectedPeople.length > 0 && (
|
||||||
<div className='absolute mx-auto bottom-0 w-full py-2 dark:bg-white bg-black -mx-2 px-2'>
|
<div className='absolute mx-auto bottom-0 w-full py-2 bg-white darl:bg-black -mx-2 px-2'>
|
||||||
<Button variant="outline" className="!py-0.5 !px-2 text-xs h-7" onClick={handleHideSelectedPeople}>
|
<Button variant="outline" className="!py-0.5 !px-2 text-xs h-7" onClick={handleHideSelectedPeople}>
|
||||||
Hide {selectedPeople.length} people
|
Hide {selectedPeople.length} people
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export default function PotentialAlbumsDates() {
|
|||||||
}, [filters]);
|
}, [filters]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="overflow-y-auto min-w-[200px] py-4 max-h-[calc(100vh-60px)] min-h-[calc(100vh-60px)] dark:bg-zinc-900 bg-gray-200 flex flex-col gap-2 px-2">
|
<div className="min-w-[200px] py-4 max-h-[calc(100vh-60px)] min-h-[calc(100vh-60px)] border-r border-gray-200 dark:border-zinc-800 flex flex-col gap-2 px-1">
|
||||||
<div className="flex justify-between items-center gap-2">
|
<div className="flex justify-between items-center gap-2">
|
||||||
<Select
|
<Select
|
||||||
defaultValue={filters.sortBy}
|
defaultValue={filters.sortBy}
|
||||||
@@ -69,14 +69,15 @@ export default function PotentialAlbumsDates() {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="overflow-y-auto">
|
||||||
{dateRecords.map((record) => (
|
{dateRecords.map((record) => (
|
||||||
<PotentialDateItem
|
<PotentialDateItem
|
||||||
key={record.date}
|
key={record.date}
|
||||||
record={record}
|
record={record}
|
||||||
onSelect={handleSelect}
|
onSelect={handleSelect}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -20,11 +20,11 @@ export default function PotentialDateItem({ record, onSelect }: IProps) {
|
|||||||
onClick={() => onSelect(record.date)}
|
onClick={() => onSelect(record.date)}
|
||||||
key={record.date}
|
key={record.date}
|
||||||
className={
|
className={
|
||||||
cn("flex gap-1 flex-col p-2 py-1 rounded-lg hover:dark:bg-zinc-800 border border-transparent hover:bg-zinc-100 px-4",
|
cn("flex gap-1 flex-col p-2 py-1 rounded-lg hover:dark:bg-zinc-800 border border-transparent hover:bg-zinc-100",
|
||||||
startDate === record.date ? "bg-zinc-100 dark:bg-zinc-800 border-gray-300 dark:border-zinc-700" : "")
|
startDate === record.date ? "bg-zinc-100 dark:bg-zinc-800 border-gray-300 dark:border-zinc-700" : "")
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<p className="font-mono text-sm">{dateLabel}</p>
|
<p className="text-sm">{dateLabel}</p>
|
||||||
<p className="text-xs text-foreground/50">{record.asset_count} Orphan Assets</p>
|
<p className="text-xs text-foreground/50">{record.asset_count} Orphan Assets</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export default function AssetHeatMap() {
|
|||||||
const threshold2 = minCount + range * 0.4;
|
const threshold2 = minCount + range * 0.4;
|
||||||
const threshold3 = minCount + range * 0.6;
|
const threshold3 = minCount + range * 0.6;
|
||||||
const threshold4 = minCount + range * 0.8;
|
const threshold4 = minCount + range * 0.8;
|
||||||
if (count === 0) return "bg-zinc-800";
|
if (count === 0) return "bg-zinc-200 dark:bg-zinc-800";
|
||||||
if (count <= threshold1) return "bg-green-200";
|
if (count <= threshold1) return "bg-green-200";
|
||||||
if (count <= threshold2) return "bg-green-400";
|
if (count <= threshold2) return "bg-green-400";
|
||||||
if (count <= threshold3) return "bg-green-500";
|
if (count <= threshold3) return "bg-green-500";
|
||||||
|
|||||||
@@ -74,13 +74,14 @@ export default function PotentialAlbums() {
|
|||||||
<Header
|
<Header
|
||||||
leftComponent="Potential Albums"
|
leftComponent="Potential Albums"
|
||||||
rightComponent={
|
rightComponent={
|
||||||
<>
|
<div className="flex gap-2 items-center">
|
||||||
<Badge variant={"outline"}>
|
<Badge variant={"outline"}>
|
||||||
{config.selectedIds.length} Selected
|
{config.selectedIds.length} Selected
|
||||||
</Badge>
|
</Badge>
|
||||||
{config.selectedIds.length && config.selectedIds.length === config.assets.length ? (
|
{config.selectedIds.length && config.selectedIds.length === config.assets.length ? (
|
||||||
<Button
|
<Button
|
||||||
variant={"outline"}
|
variant={"outline"}
|
||||||
|
size={"sm"}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
setConfig({
|
setConfig({
|
||||||
...config,
|
...config,
|
||||||
@@ -93,6 +94,7 @@ export default function PotentialAlbums() {
|
|||||||
) : (
|
) : (
|
||||||
<Button
|
<Button
|
||||||
variant={"outline"}
|
variant={"outline"}
|
||||||
|
size={"sm"}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
setConfig({
|
setConfig({
|
||||||
...config,
|
...config,
|
||||||
@@ -106,7 +108,7 @@ export default function PotentialAlbums() {
|
|||||||
<AlbumSelectorDialog onSelected={handleSelect} />
|
<AlbumSelectorDialog onSelected={handleSelect} />
|
||||||
<AlbumCreateDialog onSubmit={handleCreate} assetIds={config.assets.map((a) => a.id)} />
|
<AlbumCreateDialog onSubmit={handleCreate} assetIds={config.assets.map((a) => a.id)} />
|
||||||
<AssetsOptions assets={selectedAssets} onAdd={() => { }} />
|
<AssetsOptions assets={selectedAssets} onAdd={() => { }} />
|
||||||
</>
|
</div>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<PotentialAlbumContext.Provider
|
<PotentialAlbumContext.Provider
|
||||||
|
|||||||
Reference in new issue
Block a user