feat: disable payment method select when no payment methods configured
- Add userSettings prop to LocationEditForm to check payment configuration - Disable payment method dropdown when neither IBAN nor Revolut is enabled - Force select value to "none" when both methods are disabled - Disable individual IBAN/Revolut options when not configured - Display NoteBox warning explaining why payment options are unavailable - Update LocationEditPage and LocationAddPage to fetch and pass userSettings - Add English and Croatian translations for disabled state message This prevents users from configuring location payment methods before setting up their own payment info. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { notFound } from 'next/navigation';
|
||||
import { LocationEditForm } from '@/app/ui/LocationEditForm';
|
||||
import { fetchLocationById } from '@/app/lib/actions/locationActions';
|
||||
import { getUserSettings } from '@/app/lib/actions/userSettingsActions';
|
||||
|
||||
export default async function LocationEditPage({ locationId }: { locationId:string }) {
|
||||
|
||||
@@ -10,7 +11,9 @@ export default async function LocationEditPage({ locationId }: { locationId:stri
|
||||
return(notFound());
|
||||
}
|
||||
|
||||
const result = <LocationEditForm location={location} />;
|
||||
|
||||
const userSettings = await getUserSettings();
|
||||
|
||||
const result = <LocationEditForm location={location} userSettings={userSettings} />;
|
||||
|
||||
return (result);
|
||||
}
|
||||
Reference in New Issue
Block a user