merge: resolve conflict

This commit is contained in:
rstubryan
2025-10-16 10:59:36 +07:00
16 changed files with 1154 additions and 120 deletions
+11
View File
@@ -0,0 +1,11 @@
import InventoryAdjustmentForm from "@/components/pages/inventory/adjustment/form/InventoryAdjustmentForm";
const CreateInventoryAdjustment = () => {
return (
<section className="w-full p-4 flex flex-row justify-center">
<InventoryAdjustmentForm/>
</section>
);
}
export default CreateInventoryAdjustment;
@@ -0,0 +1,46 @@
'use client';
import { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';
import InventoryAdjustmentForm from '@/components/pages/inventory/adjustment/form/InventoryAdjustmentForm';
import type { InventoryAdjustment } from '@/types/api/inventory/adjustment';
const DetailInventoryAdjustment = () => {
const router = useRouter();
const [inventoryAdjustment, setInventoryAdjustment] = useState<InventoryAdjustment | null>(null);
// Ambil data dari router state
useEffect(() => {
console.log("Router State");
console.log(window.history.state);
const state = window.history.state?.usr as
| { inventoryAdjustment?: InventoryAdjustment }
| undefined;
if (state?.inventoryAdjustment) {
// jika object dikirim via router.push(state)
setInventoryAdjustment(state.inventoryAdjustment);
}
}, [router]);
const finalData = inventoryAdjustment;
console.log("Final Data");
console.log(finalData);
if (!finalData) {
return (
<div className="w-full flex flex-row justify-center items-center p-4">
<span className="loading loading-spinner loading-xl" />
</div>
);
}
return (
<section className="w-full p-4 flex flex-row justify-center">
<InventoryAdjustmentForm initialValues={finalData} />
</section>
);
};
export default DetailInventoryAdjustment;
+11
View File
@@ -0,0 +1,11 @@
import InventoryAdjustmentTable from '@/components/pages/inventory/adjustment/InventoryAdjustmentTable';
const InventoryAdjustment = () => {
return (
<section className='w-full p-4'>
<InventoryAdjustmentTable />
</section>
);
};
export default InventoryAdjustment;