You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.2 KiB
44 lines
1.2 KiB
"use client";
|
|
|
|
import { CropEditSession } from "./CropEditSession";
|
|
import { InpaintingEditSession } from "./InpaintingEditSession";
|
|
import { OutpaintingEditSession } from "./OutpaintingEditSession";
|
|
import { SplitGridEditSession } from "./SplitGridEditSession";
|
|
import { AnnotationEditSession } from "./AnnotationEditSession";
|
|
import type { ImageEditSessionProps } from "./types";
|
|
|
|
export function ImageEditSession({
|
|
tool,
|
|
nodeId,
|
|
imageRef,
|
|
imageSource,
|
|
dimensions,
|
|
models,
|
|
splitGridSelection,
|
|
onClose,
|
|
}: ImageEditSessionProps) {
|
|
if (!tool) return null;
|
|
|
|
const commonProps = {
|
|
nodeId,
|
|
imageRef,
|
|
imageSource,
|
|
dimensions,
|
|
onClose,
|
|
};
|
|
|
|
switch (tool) {
|
|
case "crop":
|
|
return <CropEditSession {...commonProps} title="裁剪" />;
|
|
case "outpainting":
|
|
return <OutpaintingEditSession {...commonProps} model={models.outpainting} />;
|
|
case "inpainting":
|
|
return <InpaintingEditSession {...commonProps} model={models.inpainting} />;
|
|
case "splitGrid":
|
|
return splitGridSelection ? <SplitGridEditSession {...commonProps} selection={splitGridSelection} /> : null;
|
|
case "annotate":
|
|
return <AnnotationEditSession {...commonProps} />;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
|