-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unbreak API by fixing route import (#228)
- Loading branch information
Showing
8 changed files
with
76 additions
and
76 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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
"use client"; | ||
|
||
import classNames from "classnames"; | ||
import { createContext, ReactNode, useState } from "react"; | ||
|
||
export interface DataDisplayInfo { | ||
title: string; | ||
value?: string | React.JSX.Element | React.JSX.Element[]; | ||
} | ||
|
||
/** | ||
* Functional component for displaying data. | ||
* @param props - Props for the component. | ||
* @param props.item - The display data item(s) to be rendered. | ||
* @param [props.className] - Additional class name for styling purposes. | ||
* @returns - A React element representing the display of data. | ||
*/ | ||
export const DataDisplay: React.FC<{ | ||
item: DataDisplayInfo; | ||
className?: string; | ||
}> = ({ | ||
item, | ||
className, | ||
}: { | ||
item: DataDisplayInfo; | ||
className?: string; | ||
}): React.JSX.Element => { | ||
return ( | ||
<div> | ||
<div className="grid-row"> | ||
<div className="data-title" id={item.title}> | ||
{item.title} | ||
</div> | ||
<div | ||
className={classNames("grid-col-auto maxw7 text-pre-line", className)} | ||
> | ||
{item.value} | ||
</div> | ||
</div> | ||
<div className={"section__line_gray"} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export interface DataContextValue { | ||
data: unknown; // You can define a specific data type here | ||
setData: (data: unknown) => void; | ||
} | ||
|
||
export const DataContext = createContext<DataContextValue | undefined>( | ||
undefined, | ||
); | ||
|
||
/** | ||
* | ||
* @param root0 - Children | ||
* @param root0.children - Children | ||
* @returns - The data provider component. | ||
*/ | ||
export function DataProvider({ children }: { children: ReactNode }) { | ||
const [data, setData] = useState<unknown | null>(null); | ||
|
||
return ( | ||
<DataContext.Provider value={{ data, setData }}> | ||
{children} | ||
</DataContext.Provider> | ||
); | ||
} | ||
|
||
export default DataProvider; |
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
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
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
68 changes: 0 additions & 68 deletions
68
query-connector/src/app/utils.tsx → query-connector/src/app/utils.ts
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