()
| 107 | }; |
| 108 | |
| 109 | const SavedGraphsTemplate: FC = () => { |
| 110 | const { user } = useAuthState(); |
| 111 | const userID = useMemo(() => user!.uid, [user]); |
| 112 | const { graphs } = usePersonalGraphs(user ? user.uid : ""); |
| 113 | const [isCreateGraphDialogOpen, setIsCreateGraphDialogOpen] = useState(false); |
| 114 | |
| 115 | return ( |
| 116 | <> |
| 117 | <SEO |
| 118 | title="Saved Graphs" |
| 119 | description="View and manage your saved graphs" |
| 120 | /> |
| 121 | <div className="mx-14 my-10 flex w-full flex-col gap-y-5"> |
| 122 | <h3 className="flex flex-row justify-between text-xl font-semibold text-gray-700"> |
| 123 | <div className="flex flex-row items-center gap-2"> |
| 124 | <ShareIcon className="mt-0.5 inline-block h-7 w-7 text-gray-400" /> |
| 125 | Saved Graphs |
| 126 | </div> |
| 127 | <BigButton |
| 128 | text="New graph" |
| 129 | onClick={() => { |
| 130 | setIsCreateGraphDialogOpen(true); |
| 131 | }} |
| 132 | Icon={PlusCircleIcon} |
| 133 | /> |
| 134 | </h3> |
| 135 | <div className="h-[1px] w-full bg-gray-200" /> |
| 136 | <div className="scrollbar overflow-x-hidden overflow-y-scroll"> |
| 137 | <div className="grid auto-rows-auto grid-cols-3 gap-4 pr-3"> |
| 138 | {graphs.map((graph) => ( |
| 139 | <GraphCard graph={graph} key={graph.uid} userID={userID} /> |
| 140 | ))} |
| 141 | </div> |
| 142 | </div> |
| 143 | <CreateGraphDialog |
| 144 | isOpen={isCreateGraphDialogOpen} |
| 145 | setOpen={setIsCreateGraphDialogOpen} |
| 146 | /> |
| 147 | </div> |
| 148 | </> |
| 149 | ); |
| 150 | }; |
| 151 | |
| 152 | export default SavedGraphsTemplate; |
nothing calls this directly
no test coverage detected