oddsgate-ds 1.0.205 → 1.0.207

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@ type GlossaryProps = {
7
7
  categoryData: Record<string, string[]>;
8
8
  displayedCategories: string[];
9
9
  placeholder?: string;
10
+ noResults?: boolean;
10
11
  };
11
12
  export declare const Glossary: React.FC<GlossaryProps>;
12
13
  export default Glossary;
package/dist/types.d.ts CHANGED
@@ -728,6 +728,7 @@ type GlossaryProps = {
728
728
  categoryData: Record<string, string[]>;
729
729
  displayedCategories: string[];
730
730
  placeholder?: string;
731
+ noResults?: boolean;
731
732
  };
732
733
  declare const Glossary: React__default.FC<GlossaryProps>;
733
734
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oddsgate-ds",
3
- "version": "1.0.205",
3
+ "version": "1.0.207",
4
4
  "description": "Miew theme component library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -14,19 +14,23 @@ const CategoriesWrapper: React.FC<CategoriesWrapperProps> = ({
14
14
  categoryItems
15
15
  }) => {
16
16
  return (
17
- <StyledCategoryWrapper>
18
- <StyledCategorySeparator>
19
- {category}
20
- <StyledCategorySeparatorLine />
21
- </StyledCategorySeparator>
22
- <StyledCategoryContent>
23
- {categoryItems.map((item, index) => (
24
- <StyledCategoryItem key={index}>
25
- <Button variant="text">{item}</Button>
26
- </StyledCategoryItem>
27
- ))}
28
- </StyledCategoryContent>
29
- </StyledCategoryWrapper>
17
+ <>
18
+ {categoryItems.length > 0 && (
19
+ <StyledCategoryWrapper>
20
+ <StyledCategorySeparator>
21
+ {category}
22
+ <StyledCategorySeparatorLine />
23
+ </StyledCategorySeparator>
24
+ <StyledCategoryContent>
25
+ {categoryItems.map((item, index) => (
26
+ <StyledCategoryItem key={index}>
27
+ <Button variant="text">{item}</Button>
28
+ </StyledCategoryItem>
29
+ ))}
30
+ </StyledCategoryContent>
31
+ </StyledCategoryWrapper>
32
+ )}
33
+ </>
30
34
  )
31
35
  }
32
36
 
@@ -13,6 +13,7 @@ type GlossaryProps = {
13
13
  categoryData: Record<string, string[]>
14
14
  displayedCategories: string[]
15
15
  placeholder?: string
16
+ noResults?: boolean
16
17
  }
17
18
 
18
19
  export const Glossary: React.FC<GlossaryProps> = ({
@@ -22,7 +23,8 @@ export const Glossary: React.FC<GlossaryProps> = ({
22
23
  setSelectedCategory,
23
24
  categoryData,
24
25
  displayedCategories,
25
- placeholder
26
+ placeholder,
27
+ noResults
26
28
  }) => {
27
29
  const categoryNames = Object.keys(categoryData)
28
30
 
@@ -41,7 +43,7 @@ export const Glossary: React.FC<GlossaryProps> = ({
41
43
  setSelectedCategory(cat === selectedCategory ? null : cat)
42
44
  }
43
45
  />
44
- {displayedCategories.length === 0 ? (
46
+ {noResults ? (
45
47
  <StyledNoResultsContainer>
46
48
  <StyledNoResultsTitle>No results found!</StyledNoResultsTitle>
47
49
  <StyledNoResultsSubtitle>Try another term</StyledNoResultsSubtitle>