From 9cd0ed818aecc135aa0244c6add605eec36e47d4 Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Sun, 18 Jan 2026 01:25:37 +0000 Subject: [PATCH] Add shared Next.js config props type --- .../project-settings/NextJsApplicationCard.tsx | 9 ++------- src/components/project-settings/NextJsConfigTab.tsx | 9 ++------- src/components/project-settings/NextJsFeaturesCard.tsx | 9 ++------- src/components/project-settings/types.ts | 6 ++++++ 4 files changed, 12 insertions(+), 21 deletions(-) create mode 100644 src/components/project-settings/types.ts diff --git a/src/components/project-settings/NextJsApplicationCard.tsx b/src/components/project-settings/NextJsApplicationCard.tsx index ac97ba6..a9ab41d 100644 --- a/src/components/project-settings/NextJsApplicationCard.tsx +++ b/src/components/project-settings/NextJsApplicationCard.tsx @@ -1,18 +1,13 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' -import { NextJsConfig } from '@/types/project' import projectSettingsCopy from '@/data/project-settings.json' - -interface NextJsApplicationCardProps { - nextjsConfig: NextJsConfig - onNextjsConfigChange: (config: NextJsConfig | ((current: NextJsConfig) => NextJsConfig)) => void -} +import { NextJsConfigSectionProps } from '@/components/project-settings/types' export function NextJsApplicationCard({ nextjsConfig, onNextjsConfigChange, -}: NextJsApplicationCardProps) { +}: NextJsConfigSectionProps) { const { application } = projectSettingsCopy.nextjs return ( diff --git a/src/components/project-settings/NextJsConfigTab.tsx b/src/components/project-settings/NextJsConfigTab.tsx index fab7665..43501bc 100644 --- a/src/components/project-settings/NextJsConfigTab.tsx +++ b/src/components/project-settings/NextJsConfigTab.tsx @@ -1,16 +1,11 @@ -import { NextJsConfig } from '@/types/project' import { NextJsApplicationCard } from '@/components/project-settings/NextJsApplicationCard' import { NextJsFeaturesCard } from '@/components/project-settings/NextJsFeaturesCard' - -interface NextJsConfigTabProps { - nextjsConfig: NextJsConfig - onNextjsConfigChange: (config: NextJsConfig | ((current: NextJsConfig) => NextJsConfig)) => void -} +import { NextJsConfigSectionProps } from '@/components/project-settings/types' export function NextJsConfigTab({ nextjsConfig, onNextjsConfigChange, -}: NextJsConfigTabProps) { +}: NextJsConfigSectionProps) { return (
NextJsConfig)) => void -} +import { NextJsConfigSectionProps } from '@/components/project-settings/types' export function NextJsFeaturesCard({ nextjsConfig, onNextjsConfigChange, -}: NextJsFeaturesCardProps) { +}: NextJsConfigSectionProps) { const { features } = projectSettingsCopy.nextjs return ( diff --git a/src/components/project-settings/types.ts b/src/components/project-settings/types.ts new file mode 100644 index 0000000..eeead81 --- /dev/null +++ b/src/components/project-settings/types.ts @@ -0,0 +1,6 @@ +import { NextJsConfig } from '@/types/project' + +export type NextJsConfigSectionProps = { + nextjsConfig: NextJsConfig + onNextjsConfigChange: (config: NextJsConfig | ((current: NextJsConfig) => NextJsConfig)) => void +}