feat: 收口多品牌与模板构建基础
This commit is contained in:
1 parent
0425a1c672
commit
77224ea51f
317 files changed
+11290
-1158
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import { Image, Input, Space, Typography } from "antd";
|
||||
|
||||
interface ImageUrlFieldProps {
|
||||
value?: string;
|
||||
onChange?: (value: string) => void;
|
||||
placeholder?: string;
|
||||
}
|
||||
|
||||
export function ImageUrlField({ value, onChange, placeholder }: ImageUrlFieldProps) {
|
||||
const imageUrl = typeof value === "string" ? value.trim() : "";
|
||||
return (
|
||||
<Space direction="vertical" size={8} style={{ width: "100%" }}>
|
||||
<Input
|
||||
value={value}
|
||||
onChange={(event) => onChange?.(event.target.value)}
|
||||
placeholder={placeholder ?? "粘贴图片地址"}
|
||||
/>
|
||||
{imageUrl ? (
|
||||
<Space align="start">
|
||||
<Image
|
||||
src={imageUrl}
|
||||
width={96}
|
||||
height={64}
|
||||
preview
|
||||
fallback="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="
|
||||
style={{ objectFit: "cover", borderRadius: 8, background: "#f5f5f5" }}
|
||||
/>
|
||||
<Typography.Text type="secondary">预览图</Typography.Text>
|
||||
</Space>
|
||||
) : null}
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user