Add initial app structure with Inertia.js integration

This commit is contained in:
2026-03-17 19:11:37 +07:00
parent 1dd800bcee
commit 1aff175819
2 changed files with 35 additions and 0 deletions

21
resources/js/app.jsx Normal file
View File

@@ -0,0 +1,21 @@
import "./bootstrap";
import "../css/app.css";
import { createRoot } from "react-dom/client";
import { createInertiaApp } from "@inertiajs/react";
import { resolvePageComponent } from "laravel-vite-plugin/inertia-helpers";
createInertiaApp({
title: (title) => `${title} - Perpustakaanku`,
resolve: (name) =>
resolvePageComponent(
`./Pages/${name}.jsx`,
import.meta.glob("./Pages/**/*.jsx"),
),
setup({ el, App, props }) {
const root = createRoot(el);
root.render(<App {...props} />);
},
progress: {
color: "#4F46E5",
},
});

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '.', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Perpustakaanku</title>
@viteReactRefresh
@vite(['resources/css/app.css', 'resources/js/app.jsx'])
@inertiaHead
</head>
<body class="bg-gray-100">
@inertia
</body>
</html>