diff --git a/src/app/page.module.css b/src/app/page.module.css
index ab686ca..f7ac367 100644
--- a/src/app/page.module.css
+++ b/src/app/page.module.css
@@ -1,3 +1,3 @@
-.main {
- margin: 10px;
+.body {
+ padding: 10px;
}
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 4473ca7..a801aa6 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -1,9 +1,41 @@
import { getQueue, getCurrentPlayback } from "@/utils/queue";
import styles from "./page.module.css";
import { redirect } from "next/navigation";
+import TitleBar from "./titlebar";
import TrackCover from "./track_cover";
import TrackList from "./track_list";
-import Form from "./form";
+
+interface Props {
+ queue: any;
+ currentPlayback: any;
+}
+
+export function Body({ queue, currentPlayback }: Props) {
+ return (
+
+
Currently playing
+ {(() => {
+ if (
+ currentPlayback?.isPlaying &&
+ currentPlayback.item?.type === "track"
+ ) {
+ return
;
+ } else {
+ return
Play any song on Spotify to get started!
;
+ }
+ })()}
+
+
Queue
+ {(() => {
+ if (queue !== null && queue.length > 0) {
+ return
;
+ } else {
+ return
Your song queue is empty.
;
+ }
+ })()}
+
+ );
+}
export default async function Home() {
const [queue, currentPlayback] = await Promise.all([
@@ -14,21 +46,8 @@ export default async function Home() {
return (
-
-
- {currentPlayback?.isPlaying && currentPlayback.item?.type === "track" && (
- <>
- Currently playing
-
- >
- )}
-
- {queue.length > 0 && (
- <>
- Queue
-
- >
- )}
+
+
);
}
diff --git a/src/app/search.module.css b/src/app/search.module.css
new file mode 100644
index 0000000..a6ac99d
--- /dev/null
+++ b/src/app/search.module.css
@@ -0,0 +1,16 @@
+.input {
+ border: 1px solid #999999;
+ height: 40px;
+ box-sizing: border-box;
+ padding: 1px 10px;
+ outline: none;
+ transition: 0.2s ease-in-out;
+ width: 100%;
+ border-radius: 20px;
+ margin-bottom: 5px;
+}
+
+.input:focus {
+ transition: 0.2s ease-in-out;
+ border: 1px solid #1fdf64;
+}
diff --git a/src/app/form.tsx b/src/app/search.tsx
similarity index 82%
rename from src/app/form.tsx
rename to src/app/search.tsx
index 0a723d0..d87d6eb 100644
--- a/src/app/form.tsx
+++ b/src/app/search.tsx
@@ -1,12 +1,14 @@
"use client";
import { useEffect, useState } from "react";
+import { useRouter } from "next/navigation";
import * as Spotify from "spotify-api.js";
import { pushTrack, searchTracks } from "./actions";
import { TrackHeader, TrackItem } from "./track_list";
-import { useRouter } from "next/navigation";
+import styles from "./search.module.css";
+import track_styles from "./track_list.module.css";
-export default function Form() {
+export default function Search() {
const router = useRouter();
const [query, setQuery] = useState("");
const [results, setResults] = useState([]);
@@ -32,17 +34,18 @@ export default function Form() {
return (