Fix upload page AI incompatibilities
This commit is contained in:
parent
097496a739
commit
ec828f6977
@ -3,7 +3,6 @@ import { extractExifDataFromBlobPath } from '@/photo/server';
|
|||||||
import { redirect } from 'next/navigation';
|
import { redirect } from 'next/navigation';
|
||||||
import { getUniqueTagsCached } from '@/photo/cache';
|
import { getUniqueTagsCached } from '@/photo/cache';
|
||||||
import UploadPageClient from '@/photo/UploadPageClient';
|
import UploadPageClient from '@/photo/UploadPageClient';
|
||||||
import { AI_TEXT_GENERATION_ENABLED } from '@/site/config';
|
|
||||||
|
|
||||||
interface Params {
|
interface Params {
|
||||||
params: { uploadPath: string }
|
params: { uploadPath: string }
|
||||||
@ -19,14 +18,11 @@ export default async function UploadPage({ params: { uploadPath } }: Params) {
|
|||||||
|
|
||||||
const uniqueTags = await getUniqueTagsCached();
|
const uniqueTags = await getUniqueTagsCached();
|
||||||
|
|
||||||
const aiTextGeneration = AI_TEXT_GENERATION_ENABLED;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<UploadPageClient {...{
|
<UploadPageClient {...{
|
||||||
blobId,
|
blobId,
|
||||||
photoFormExif,
|
photoFormExif,
|
||||||
uniqueTags,
|
uniqueTags,
|
||||||
aiTextGeneration,
|
|
||||||
}} />
|
}} />
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -11,12 +11,10 @@ export default function UploadPageClient({
|
|||||||
blobId,
|
blobId,
|
||||||
photoFormExif,
|
photoFormExif,
|
||||||
uniqueTags,
|
uniqueTags,
|
||||||
aiTextGeneration,
|
|
||||||
}: {
|
}: {
|
||||||
blobId?: string
|
blobId?: string
|
||||||
photoFormExif: Partial<PhotoFormData>
|
photoFormExif: Partial<PhotoFormData>
|
||||||
uniqueTags: Tags
|
uniqueTags: Tags
|
||||||
aiTextGeneration: boolean
|
|
||||||
}) {
|
}) {
|
||||||
const [pending, setIsPending] = useState(false);
|
const [pending, setIsPending] = useState(false);
|
||||||
const [updatedTitle, setUpdatedTitle] = useState('');
|
const [updatedTitle, setUpdatedTitle] = useState('');
|
||||||
@ -33,7 +31,6 @@ export default function UploadPageClient({
|
|||||||
<PhotoForm
|
<PhotoForm
|
||||||
initialPhotoForm={photoFormExif}
|
initialPhotoForm={photoFormExif}
|
||||||
uniqueTags={uniqueTags}
|
uniqueTags={uniqueTags}
|
||||||
aiTextGeneration={aiTextGeneration}
|
|
||||||
onTitleChange={setUpdatedTitle}
|
onTitleChange={setUpdatedTitle}
|
||||||
onFormStatusChange={setIsPending}
|
onFormStatusChange={setIsPending}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user