Vercel/src/components/SmallDisclosure.tsx
Sam Becker b8c01492b8
Store optimized assets for all photos (#304)
* Begin storing optimized photo files

* Increase optimized image size to 1080

* Refactor photo/storage modules

* Refine storage file naming api

* Simplify photo storage api

* Finalize photo storage api

* Start storing/serving optimized photos

* Finalize optimized photo asset generation

* Temporarily allow static optimization on PREVIEW branches

* Restore static optimization as production-only

* Remove og image inline-flex class

* Tweak convert upload signature

* Refactor optimized file storage

* Display optimized files when they exist in photo form

* Create small disclosure component

* Report photo storage files more accurately

* Sort optimized files

* Generate optimized storage files when updating/syncing photos

* Include source bucket when copying files with MinIO

* Make deleting files more resilient
2025-09-06 23:20:20 -05:00

38 lines
856 B
TypeScript

import clsx from 'clsx/lite';
import { ReactNode, useState } from 'react';
import { LuChevronRight } from 'react-icons/lu';
export default function SmallDisclosure({
label,
children,
}: {
label: ReactNode
children: ReactNode
}) {
const [isOpen, setIsOpen] = useState(false);
return (
<div className="space-y-2">
<button
type="button"
className={clsx(
'flex items-center gap-1.5 link',
'hover:opacity-100!',
)}
onClick={() => setIsOpen(!isOpen)}
>
<span className={clsx(
'transition-transform duration-200',
isOpen && 'rotate-90',
)}>
<LuChevronRight size={16} />
</span>
<span>{label}</span>
</button>
{isOpen &&
<div className="pl-5.5">
{children}
</div>}
</div>
);
}