format and fix
This commit is contained in:
@@ -31,12 +31,14 @@ type FlutterViewProps = {
|
||||
state: Record<string, unknown>;
|
||||
onEvent: (event: { type: string; payload?: Record<string, unknown> }) => void;
|
||||
className?: string;
|
||||
height?: number;
|
||||
};
|
||||
|
||||
export function FlutterView({
|
||||
state,
|
||||
onEvent,
|
||||
className,
|
||||
height,
|
||||
}: FlutterViewProps) {
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
const [status, setStatus] = useState<"loading" | "ready" | "error">(
|
||||
@@ -142,7 +144,7 @@ export function FlutterView({
|
||||
}, [state]);
|
||||
|
||||
return (
|
||||
<div className={className} style={{ height: "100%", position: "relative" }}>
|
||||
<div className={className} style={{ position: "relative" }}>
|
||||
{status === "loading" && (
|
||||
<div
|
||||
style={{
|
||||
@@ -170,7 +172,10 @@ export function FlutterView({
|
||||
Failed to load Flutter view
|
||||
</div>
|
||||
)}
|
||||
<div ref={containerRef} style={{ width: "100%", height: "100%" }} />
|
||||
<div
|
||||
ref={containerRef}
|
||||
style={{ width: "100%", height: height ?? 400 }}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user