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
+24 -3

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@
"version": "1.0.0", "version": "1.0.0",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "start": "npx json-server coffees.json"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
+11 -1
View File
@@ -2,7 +2,17 @@
function Coffee({ coffee }) { function Coffee({ coffee }) {
return ( 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() { function Coffees() {
const[coffees,setCoffees]=useState([]);
const getCoffees=()=>{
}
useEffect(()=>{
getCoffees();
},[]);
return ( return (
<div>Coffees</div> <div>Coffees</div>
) )