2025-08-01 17:59:08 +02:00
|
|
|
import React, { useState } from 'react';
|
2025-08-01 22:16:33 +02:00
|
|
|
import { createStation } from '../utils/Stations';
|
|
|
|
|
|
|
|
// I UNDERSTAND THIS!! --Noah
|
2025-08-01 17:59:08 +02:00
|
|
|
|
|
|
|
function CreateStation() {
|
2025-08-01 22:16:33 +02:00
|
|
|
const [name, setName] = useState("");
|
|
|
|
const [description, setDescription] = useState("");
|
2025-08-01 17:59:08 +02:00
|
|
|
|
|
|
|
const handleCreateStation = () => {
|
2025-08-01 22:16:33 +02:00
|
|
|
createStation(name, description);
|
2025-08-01 17:59:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="create-station">
|
|
|
|
<header className="create-station-header">
|
|
|
|
<h1>Create a Station on Serena</h1>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<main className="create-station-content">
|
2025-08-01 22:16:33 +02:00
|
|
|
<textarea onChange={(e) => setName(e.target.value)} />
|
|
|
|
<textarea onChange={(e) => setDescription(e.target.value)} />
|
2025-08-01 17:59:08 +02:00
|
|
|
|
|
|
|
<button
|
|
|
|
className="create-station-final-btn"
|
|
|
|
onClick={handleCreateStation}
|
2025-08-01 22:16:33 +02:00
|
|
|
disabled={!name || !description}
|
2025-08-01 17:59:08 +02:00
|
|
|
>
|
|
|
|
Create Radio Station
|
|
|
|
</button>
|
|
|
|
</main>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2025-08-01 22:16:33 +02:00
|
|
|
|
2025-08-01 17:59:08 +02:00
|
|
|
export default CreateStation;
|