Remove config object pattern.

This commit is contained in:
Chad Curtis committed 2025-09-24 19:09:19 +00:00
1 parent fdfdcb4b16
commit 4f9d3ae1d1
2 files changed
+11 -23

No files matched your search

+5 -13
View File
@@ -37,12 +37,10 @@ const IFRAME_DOMAIN = import.meta.env.VITE_IFRAME_DOMAIN || 'local-shakespeare.d
interface PreviewPaneProps {
projectId: string;
activeTab: 'preview' | 'code';
config?: {
onToggleView?: () => void;
projectName?: string;
onFirstInteraction?: () => void;
isPreviewable?: boolean;
};
onToggleView?: () => void;
projectName?: string;
onFirstInteraction?: () => void;
isPreviewable?: boolean;
}
interface JSONRPCRequest {
@@ -77,13 +75,7 @@ interface JSONRPCResponse {
export function PreviewPane({ projectId, activeTab, config = {} }: PreviewPaneProps) {
const {
onToggleView,
projectName,
onFirstInteraction,
isPreviewable = true,
} = config;
export function PreviewPane({ projectId, activeTab, onToggleView, projectName, onFirstInteraction, isPreviewable = true }: PreviewPaneProps) {
const { t } = useTranslation();
const [selectedFile, setSelectedFile] = useState<string | null>(null);
const [fileContent, setFileContent] = useState<string>('');
+6 -10
View File
@@ -266,10 +266,8 @@ export function ProjectView() {
<PreviewPane
projectId={project.id}
activeTab={mobileView}
config={{
projectName: project.name,
onFirstInteraction: handleFirstInteraction,
}}
projectName={project.name}
onFirstInteraction={handleFirstInteraction}
/>
) : (
<div className="h-full p-4 space-y-4">
@@ -456,12 +454,10 @@ export function ProjectView() {
<PreviewPane
projectId={project.id}
activeTab={isPreviewable ? activeTab : 'code'}
config={{
onToggleView: isPreviewable ? () => setActiveTab(activeTab === 'preview' ? 'code' : 'preview') : undefined,
projectName: project.name,
onFirstInteraction: handleFirstInteraction,
isPreviewable,
}}
onToggleView={isPreviewable ? () => setActiveTab(activeTab === 'preview' ? 'code' : 'preview') : undefined}
projectName={project.name}
onFirstInteraction={handleFirstInteraction}
isPreviewable={isPreviewable}
/>
) : (
<div className="h-full p-4 space-y-4">