kávék lekérése

This commit is contained in:
Kovács Rudolf committed 2026-11-05 09:22:12 +01:00
1 parent 55ccd302a9
commit 237750bfef
3 files changed
+25 -4

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"start": "npx json-server coffees.json"
},
"keywords": [],
"author": "",
+12 -2
View File
@@ -1,8 +1,18 @@
function Coffee({coffee}) {
function Coffee({ coffee }) {
return (
<div>Coffee</div>
<div className="card w-96 bg-blue-200 card-md shadow-sm">
<div className="card-body">
<h2 className="card-title">{coffee.name}</h2>
<p>Roast:{coffee.roast}</p>
<p>Price:{coffee.price}</p>
<div className="justify-end card-actions">
<button className="btn btn-primary">Módosítás</button>
<button className="btn btn-primary">Törlés</button>
</div>
</div>
</div>
)
}
+12 -1
View File
@@ -1,6 +1,17 @@
import Coffee from "./Coffee"
import { useState,useEffect } from "react"
function Coffees() {
const[coffees,setCoffees]=useState([]);
const getCoffees=()=>{
}
useEffect(()=>{
getCoffees();
},[]);
return (
<div>Coffees</div>
)