diff --git a/src/app/(bluerpint-list)/FilterAndSortButton.tsx b/src/app/(bluerpint-list)/FilterAndSortButton.tsx index ee75154b..855d669e 100644 --- a/src/app/(bluerpint-list)/FilterAndSortButton.tsx +++ b/src/app/(bluerpint-list)/FilterAndSortButton.tsx @@ -7,6 +7,7 @@ import Image from 'next/image'; import { forwardRef, useState, useRef, useEffect } from 'react'; import { Status } from '@zk-email/sdk'; import { useAuthStore } from '@/lib/stores/useAuthStore'; +import { motion, AnimatePresence } from 'framer-motion'; type FilterAndSortButtonProps = ButtonProps & {}; @@ -69,15 +70,87 @@ const FilterAndSortButton = forwardRef - + - {expanded && ( -
- {username && ( - <> -
- { - handleFilter(Status.Draft, checked); - }} - /> - { - handleFilter(Status.Done, checked); - }} - /> - { - handleFilter(Status.InProgress, checked); + + {expanded && ( + + {username && ( + <> + + filter + Filter + + + + {filterItems.map((item, index) => ( + + { + handleFilter(item.value, checked); + }} + /> + + ))} + + + - { - handleFilter(Status.Failed, checked); - }} - /> -
-
-
- filter - Sort -
- - )} -
- { - handleSort('stars', checked); - }} - /> - { - handleSort('updatedAt', checked); - }} - /> -
-
- )} + + + sort + Sort + + + )} + + + {sortItems.map((item, index) => ( + + { + handleSort(item.value, checked); + }} + /> + + ))} + + + )} +
); } diff --git a/src/app/[id]/versions/page.tsx b/src/app/[id]/versions/page.tsx index 143943f1..84314eef 100644 --- a/src/app/[id]/versions/page.tsx +++ b/src/app/[id]/versions/page.tsx @@ -128,7 +128,7 @@ const VersionsPage = ({ params }: { params: Promise<{ id: string }> }) => { > {versions.length} Version{versions.length > 1 && 's'} - + {/* - + */} diff --git a/src/app/components/BlueprintCard.tsx b/src/app/components/BlueprintCard.tsx index 9e54470f..166f2114 100644 --- a/src/app/components/BlueprintCard.tsx +++ b/src/app/components/BlueprintCard.tsx @@ -90,9 +90,6 @@ const BlueprintCard = ({ blueprint, setStarred, setUnStarred, starred }: Bluepri height: 'auto', }} /> - - {(stars || 0) < 2 ? 'Star' : 'Stars'} |{' '} - {stars ?? 0} @@ -147,15 +144,21 @@ const BlueprintCard = ({ blueprint, setStarred, setUnStarred, starred }: Bluepri

{blueprint.props.description}

-

Values extracted:

- {blueprint.props.decomposedRegexes?.map((dr, index) => ( -
- {dr.name} {dr.isHashed ? '(hashed)' : ''} -
- ))} + {blueprint.props.decomposedRegexes && blueprint.props.decomposedRegexes.length > 0 ? ( + <> +

Values extracted:

+ {blueprint.props.decomposedRegexes.map((dr, index) => ( +
+ {dr.name} {dr.isHashed ? '(hashed)' : ''} +
+ ))} + + ) : ( +

Values extracted: None

+ )}
- - {blueprint.props.version} + + v {blueprint.props.version} & { helpText?: string; } ->(({ className, title, helpText, ...props }, ref) => ( -
-
- (({ className, title, helpText, ...props }, ref) => { + const internalRef = React.useRef(null); + + // Expose the checkbox element through the forwarded ref + React.useImperativeHandle(ref, () => internalRef.current as HTMLButtonElement, []); + + const handleDivClick = () => { + if (internalRef.current) { + internalRef.current.click(); + } + }; + + return ( +
+
- - - - - {title ? : null} + + + + + {title ? : null} +
+ {helpText ?

{helpText}

: null}
- {helpText ?

{helpText}

: null} -
-)); + ); +}); Checkbox.displayName = CheckboxPrimitive.Root.displayName; export { Checkbox };