mirror of
https://github.com/tmdinosaurcenter/gas-form.git
synced 2025-09-13 02:23:33 -06:00
first commit
This commit is contained in:
27
app/actions.ts
Normal file
27
app/actions.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
"use server"
|
||||
|
||||
import { fetchVehicles, submitFillup } from "@/utils/api"
|
||||
|
||||
export async function getVehicles() {
|
||||
try {
|
||||
return await fetchVehicles()
|
||||
} catch (error) {
|
||||
console.error("Error fetching vehicles:", error)
|
||||
throw new Error("Failed to fetch vehicles")
|
||||
}
|
||||
}
|
||||
|
||||
export async function submitGasFillup(data: {
|
||||
name: string
|
||||
vehicleId: string
|
||||
mileage: number
|
||||
gallons: number
|
||||
}) {
|
||||
try {
|
||||
return await submitFillup(data)
|
||||
} catch (error) {
|
||||
console.error("Error submitting fillup:", error)
|
||||
throw new Error("Failed to submit gas fillup")
|
||||
}
|
||||
}
|
||||
|
56
app/globals.css
Normal file
56
app/globals.css
Normal file
@@ -0,0 +1,56 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
@layer base {
|
||||
:root {
|
||||
--background: 300 20% 98%;
|
||||
--foreground: 195 31% 13%;
|
||||
|
||||
--card: 300 20% 98%;
|
||||
--card-foreground: 195 31% 13%;
|
||||
|
||||
--popover: 300 20% 98%;
|
||||
--popover-foreground: 195 31% 13%;
|
||||
|
||||
--primary: 181 70% 46%;
|
||||
--primary-foreground: 195 31% 13%;
|
||||
|
||||
--secondary: 191 89% 68%;
|
||||
--secondary-foreground: 195 31% 13%;
|
||||
|
||||
--muted: 195 31% 13%;
|
||||
--muted-foreground: 195 31% 45%;
|
||||
|
||||
--accent: 191 89% 68%;
|
||||
--accent-foreground: 195 31% 13%;
|
||||
|
||||
--destructive: 0 84.2% 60.2%;
|
||||
--destructive-foreground: 0 0% 98%;
|
||||
|
||||
--border: 195 31% 13%;
|
||||
--input: 195 31% 13%;
|
||||
--ring: 181 70% 46%;
|
||||
|
||||
--radius: 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@layer base {
|
||||
* {
|
||||
@apply border-border;
|
||||
}
|
||||
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
@apply font-vollkorn;
|
||||
}
|
||||
}
|
31
app/layout.tsx
Normal file
31
app/layout.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { Toaster } from "@/components/ui/toaster"
|
||||
import { Vollkorn, Open_Sans } from "next/font/google"
|
||||
import "./globals.css"
|
||||
import type React from "react" // Import React
|
||||
|
||||
const vollkorn = Vollkorn({
|
||||
subsets: ["latin"],
|
||||
weight: ["700"],
|
||||
variable: "--font-vollkorn",
|
||||
})
|
||||
|
||||
const openSans = Open_Sans({
|
||||
subsets: ["latin"],
|
||||
variable: "--font-open-sans",
|
||||
})
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body className={`${vollkorn.variable} ${openSans.variable} font-open-sans bg-background`}>
|
||||
{children}
|
||||
<Toaster />
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
}
|
||||
|
12
app/page.tsx
Normal file
12
app/page.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
"use client"
|
||||
|
||||
import GasFillupForm from "@/components/GasFillupForm"
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<main>
|
||||
<GasFillupForm />
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user