MCPcopy Create free account
hub / github.com/sqlchat/sqlchat / DataStorageBanner

Function DataStorageBanner

src/components/DataStorageBanner.tsx:10–33  ·  view source on GitHub ↗
(props: Props)

Source from the content-addressed store, hash-verified

8}
9
10const DataStorageBanner = (props: Props) => {
11 const { className, alwaysShow } = props;
12 const { t } = useTranslation();
13 const [hideBanner, setHideBanner] = useLocalStorage("hide-local-storage-banner", false);
14 const show = alwaysShow || !hideBanner;
15
16 return (
17 <div
18 className={`${!show && "!hidden"} ${
19 className || ""
20 } relative w-full flex flex-row justify-start sm:justify-center items-center px-4 py-1 bg-gray-100 dark:bg-zinc-700`}
21 >
22 <span className="text-sm leading-6 pr-4">
23 <Icon.IoInformationCircleOutline className="inline-block h-5 w-auto -mt-0.5 mr-0.5 opacity-80" />
24 {t("banner.data-storage")}
25 </span>
26 {!alwaysShow && (
27 <button className="absolute right-2 sm:right-4 opacity-60 hover:opacity-100" onClick={() => setHideBanner(true)}>
28 <Icon.BiX className="w-6 h-auto" />
29 </button>
30 )}
31 </div>
32 );
33};
34
35export default DataStorageBanner;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected