page.tsx73 lines, 2.6 KB
| 1 | import { SeedDatabaseButton } from "@/components/admin/seed-database-button"; |
| 2 | import { |
| 3 | Card, |
| 4 | CardContent, |
| 5 | CardDescription, |
| 6 | CardHeader, |
| 7 | CardTitle, |
| 8 | } from "@/components/ui/card"; |
| 9 | import { AlertTriangle, Database, RefreshCcw } from "lucide-react"; |
| 10 | import { Metadata } from "next"; |
| 11 | |
| 12 | export const metadata: Metadata = { |
| 13 | title: "Database Management | Admin | ShortLink", |
| 14 | description: "Database management tools for ShortLink application", |
| 15 | }; |
| 16 | |
| 17 | export default function DatabasePage() { |
| 18 | return ( |
| 19 | <> |
| 20 | <div className="flex items-center justify-between mb-6"> |
| 21 | <h1 className="text-3xl font-bold tracking-tight"> |
| 22 | Database Management |
| 23 | </h1> |
| 24 | </div> |
| 25 | |
| 26 | <div className="grid gap-6"> |
| 27 | <Card className="shadow-sm"> |
| 28 | <CardHeader> |
| 29 | <div className="flex items-center gap-2"> |
| 30 | <div className="p-2 rounded-md bg-purple-100 dark:bg-purple-900/20 text-purple-500"> |
| 31 | <Database className="size-5" /> |
| 32 | </div> |
| 33 | <CardTitle>Seed Database</CardTitle> |
| 34 | </div> |
| 35 | <CardDescription> |
| 36 | Populate the database with test data for development and testing |
| 37 | </CardDescription> |
| 38 | </CardHeader> |
| 39 | <CardContent> |
| 40 | <div className="space-y-4"> |
| 41 | <div className="bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 rounded-md p-4 flex items-center gap-3"> |
| 42 | <AlertTriangle className="size-5 text-amber-600 dark:text-amber-400 mt-0.5" /> |
| 43 | </div> |
| 44 | <div> |
| 45 | <h3 className="font-medium text-amber-800 dark:text-amber-300 mb-1"> |
| 46 | Development Use Only |
| 47 | </h3> |
| 48 | <p className="text-sm text-amber-700 dark:text-amber-400"> |
| 49 | This tool is intended for development and testing purposes |
| 50 | only. Seeding the database will create test users, URLs, and |
| 51 | other data. |
| 52 | </p> |
| 53 | </div> |
| 54 | </div> |
| 55 | |
| 56 | <div className="bg-muted p-4 rounded-md"> |
| 57 | <h3 className="font-medium mb-2 flex items-center gap-2"> |
| 58 | <RefreshCcw className="size-4" /> |
| 59 | Seed Database with Test Data |
| 60 | </h3> |
| 61 | <p className="text-sm text-muted-foreground mb-4"> |
| 62 | This will create test users including an admin user |
| 63 | (admin@example.com / admin123), sample URLs, and other test data |
| 64 | needed for development. |
| 65 | </p> |
| 66 | <SeedDatabaseButton /> |
| 67 | </div> |
| 68 | </CardContent> |
| 69 | </Card> |
| 70 | </div> |
| 71 | </> |
| 72 | ); |
| 73 | } |