-
Notifications
You must be signed in to change notification settings - Fork 805
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: add topology applications UI (mocked API for now)
- Loading branch information
Showing
24 changed files
with
1,222 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,23 @@ | ||
"use client"; | ||
import { Subtitle, TextInput, Title } from "@tremor/react"; | ||
import { useState } from "react"; | ||
import { ServiceSearchContext } from "./service-search-context"; | ||
|
||
export default function Layout({ children }: { children: any }) { | ||
const [serviceInput, setServiceInput] = useState<string>(""); | ||
const [serviceQuery, setServiceQuery] = useState<string>(""); | ||
const [selectedServiceId, setSelectedServiceId] = useState<string | null>( | ||
null | ||
); | ||
|
||
return ( | ||
<main className="p-4 md:p-10 mx-auto max-w-full h-full"> | ||
<div className="flex w-full justify-between"> | ||
<div> | ||
<Title>Service Topology</Title> | ||
<Subtitle> | ||
Data describing the topology of components in your environment. | ||
</Subtitle> | ||
</div> | ||
<TextInput | ||
placeholder="Search for a service" | ||
value={serviceInput} | ||
onValueChange={setServiceInput} | ||
className="w-64 mt-2" | ||
/> | ||
</div> | ||
<ServiceSearchContext.Provider value={serviceInput}> | ||
{children} | ||
</ServiceSearchContext.Provider> | ||
</main> | ||
<ServiceSearchContext.Provider | ||
value={{ | ||
serviceQuery, | ||
setServiceQuery, | ||
selectedServiceId, | ||
setSelectedServiceId, | ||
}} | ||
> | ||
{children} | ||
</ServiceSearchContext.Provider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
import { createContext } from "react"; | ||
|
||
export const ServiceSearchContext = createContext(""); | ||
export const ServiceSearchContext = createContext<{ | ||
serviceQuery: string; | ||
setServiceQuery: (query: string) => void; | ||
selectedServiceId: string | null; | ||
setSelectedServiceId: (id: string | null) => void; | ||
}>({ | ||
serviceQuery: "", | ||
setServiceQuery: (query: string) => {}, | ||
selectedServiceId: "", | ||
setSelectedServiceId: (id: string | null) => {}, | ||
}); |
Oops, something went wrong.