-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
227 additions
and
19 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,6 +1,12 @@ | ||
import { ChooseStoreDr } from "@/components/choose-store.dr" | ||
import { HeaderDr } from "@/components/ui/header.dr" | ||
import { dictionaryRequirements } from "@/lib/utils/dictionary" | ||
|
||
import { PluginDr } from "./plugin.dr" | ||
|
||
export const PluginsContentDr = dictionaryRequirements({ plugins: true, search: true }, HeaderDr, PluginDr) | ||
export const PluginsContentDr = dictionaryRequirements( | ||
{ plugins: true, search: true, stores: true }, | ||
HeaderDr, | ||
PluginDr, | ||
ChooseStoreDr | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import { ChooseStoreDr } from "@/components/choose-store.dr" | ||
import { HeaderDr } from "@/components/ui/header.dr" | ||
import { dictionaryRequirements } from "@/lib/utils/dictionary" | ||
|
||
export const TemplatesContentDr = dictionaryRequirements( | ||
{ | ||
templates: true, | ||
search: true, | ||
stores: true, | ||
}, | ||
HeaderDr | ||
HeaderDr, | ||
ChooseStoreDr | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { dictionaryRequirements } from "@/lib/utils/dictionary" | ||
|
||
import { HeaderDr } from "./ui/header.dr" | ||
|
||
export const ChooseStoreDr = dictionaryRequirements({ selectStore: true, storeVersion: true, search: true }, HeaderDr) |
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,49 @@ | ||
import { Store } from "lucide-react" | ||
|
||
import { TDictionary } from "@/lib/langs" | ||
import { RouterOutputs } from "@/lib/trpc/utils" | ||
import { Input } from "@nextui-org/input" | ||
|
||
import Header from "./ui/header" | ||
import ItemCard from "./ui/item-card" | ||
import { ChooseStoreDr } from "./choose-store.dr" | ||
|
||
export default function ChooseStore({ | ||
dictionary, | ||
stores, | ||
isLoading, | ||
search, | ||
setSearch, | ||
lnk, | ||
}: { | ||
dictionary: TDictionary<typeof ChooseStoreDr> | ||
stores: RouterOutputs["stores"]["getStores"] | undefined | ||
isLoading: boolean | ||
search: string | ||
setSearch: (search: string) => void | ||
lnk: string | ||
}) { | ||
return ( | ||
<> | ||
<Header | ||
title={dictionary.selectStore} | ||
dictionary={dictionary} | ||
actions={<Input value={search} onValueChange={setSearch} placeholder={dictionary.search} />} | ||
/> | ||
<ul className="flex flex-1 flex-col gap-2"> | ||
{isLoading | ||
? [...Array(5)].map((_, i) => <ItemCard key={i} isLoading id="" title="" description="" />) | ||
: stores?.stores.map((store) => ( | ||
<ItemCard | ||
key={store.uid} | ||
id={store.uid} | ||
title={store.name} | ||
description={dictionary.storeVersion + ": " + store.version} | ||
href={`${lnk}?storeName=${store.name}&storeVersion=${store.version}`} | ||
endContent={<Store className="absolute right-2 top-2 size-4 text-primary" />} | ||
/> | ||
))} | ||
</ul> | ||
</> | ||
) | ||
} |
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
Oops, something went wrong.