diff --git a/components/admin-dashboard.tsx b/components/admin-dashboard.tsx index a598429..fa6835d 100644 --- a/components/admin-dashboard.tsx +++ b/components/admin-dashboard.tsx @@ -61,7 +61,7 @@ export function AdminDashboard({ token, onLogout }: AdminDashboardProps) { } toast({ - variant: type === "error" ? "destructive" : "default", + variant: type === "error" ? "default" : "destructive", title: type === "error" ? "Error" : "Warning", description: error, }) diff --git a/components/admins/admins-section.tsx b/components/admins/admins-section.tsx index 1a53b20..356f9b4 100644 --- a/components/admins/admins-section.tsx +++ b/components/admins/admins-section.tsx @@ -117,7 +117,7 @@ export function AdminsSection({ admins, apiClient, onAdminsUpdate }: AdminsSecti onAdminsUpdate(updatedAdmins) toast({ - variant: "default", + variant: "destructive", title: "Admin Deleted", description: "Admin account deleted successfully!", }) @@ -130,7 +130,7 @@ export function AdminsSection({ admins, apiClient, onAdminsUpdate }: AdminsSecti onAdminsUpdate([...admins, admin]) toast({ - variant: "default", + variant: "destructive", title: "Admin Added", description: "Admin account added successfully!", }) diff --git a/components/admins/change-password-dialog.tsx b/components/admins/change-password-dialog.tsx index 1ff2c59..19c50b5 100644 --- a/components/admins/change-password-dialog.tsx +++ b/components/admins/change-password-dialog.tsx @@ -49,7 +49,7 @@ export function ChangePasswordDialog({ admin, apiClient, onClose }: ChangePasswo onClose() toast({ - variant: "default", + variant: "destructive", title: "Admin Updated", description: "Admin account password updated successfully!", }) diff --git a/components/database/add-item-drawer.tsx b/components/database/add-item-drawer.tsx index 61dd30e..7bc6637 100644 --- a/components/database/add-item-drawer.tsx +++ b/components/database/add-item-drawer.tsx @@ -95,6 +95,7 @@ export function AddItemDrawer({ table, apiClient, open, onClose, onItemAdded }: onClose() toast({ + variant: "destructive", title: "Table Created", description: `A table ${table.name} has been created successfully.`, }) @@ -225,9 +226,9 @@ export function AddItemDrawer({ table, apiClient, open, onClose, onItemAdded }: Create a new record in {table.name} table -
+
-
+
Autogenerated fields for {table.name} @@ -299,6 +300,10 @@ export function AddItemDrawer({ table, apiClient, open, onClose, onItemAdded }: { + // scroll parent container into view + e.target.scrollIntoView({ behavior: "auto", block: "center" }); + }} value={formatDateForInput(formData[field.name])} onChange={(e) => handleFieldChange(field.name, e.target.value)} disabled={(field.type === "view" || isSystemGeneratedField(field))} diff --git a/components/database/add-table-dialog.tsx b/components/database/add-table-dialog.tsx index 79ba83a..7734b77 100644 --- a/components/database/add-table-dialog.tsx +++ b/components/database/add-table-dialog.tsx @@ -170,6 +170,7 @@ export function AddTableDialog({ apiClient, onTablesUpdate, children }: AddTable setOpen(false) toast({ + variant: "destructive", title: "Table Created", description: `The table '${tableData.name}' been updated successfully.`, }) diff --git a/components/database/database-section.tsx b/components/database/database-section.tsx index dc54407..cb8908e 100644 --- a/components/database/database-section.tsx +++ b/components/database/database-section.tsx @@ -63,6 +63,7 @@ export function DatabaseSection({ apiClient, tables, onTablesUpdate }: DatabaseS onTablesUpdate(updatedTables) toast({ + variant: "destructive", title: "Table Deleted", description: "Table deleted successfully!", }) diff --git a/components/database/edit-item-drawer.tsx b/components/database/edit-item-drawer.tsx index 53eda73..6f0bc70 100644 --- a/components/database/edit-item-drawer.tsx +++ b/components/database/edit-item-drawer.tsx @@ -57,6 +57,7 @@ export function EditItemDrawer({ table, item, apiClient, open, onClose, onItemUp onClose() toast({ + variant: "destructive", title: "Table Updated", description: "Table data has been updated successfully.", }) diff --git a/components/database/table-config-drawer.tsx b/components/database/table-config-drawer.tsx index 7cd00d2..1481f65 100644 --- a/components/database/table-config-drawer.tsx +++ b/components/database/table-config-drawer.tsx @@ -132,6 +132,7 @@ export function TableConfigDrawer({ table, apiClient, open, onClose, onTableUpda onTableUpdate(updatedTable) toast({ + variant: "destructive", title: "Table Updated", description: "Table fields updated successfully.", }) @@ -162,6 +163,7 @@ export function TableConfigDrawer({ table, apiClient, open, onClose, onTableUpda onTableUpdate(updatedTable) toast({ + variant: "destructive", title: "Table Updated", description: "Table access rules updated successfully!", }) diff --git a/components/settings/settings-section.tsx b/components/settings/settings-section.tsx index d2ee774..10dd11d 100644 --- a/components/settings/settings-section.tsx +++ b/components/settings/settings-section.tsx @@ -74,6 +74,7 @@ export function SettingsSection({ apiClient, settings, onSettingsUpdate, onModeC setHasChanges(false) toast({ + variant: "destructive", title: "Settings Saved", description: "Application settings have been updated successfully.", })