|
1 | 1 | import { type ReactNode, useState, ReactElement } from "react";
|
2 |
| -import { useOrganizationId, usePermissions } from "hooks"; |
| 2 | +import { useOrganizationId } from "hooks"; |
| 3 | +import { Language } from "./WorkspacesPageView"; |
3 | 4 |
|
4 | 5 | import { useQuery } from "@tanstack/react-query";
|
5 | 6 | import { type Template } from "api/typesGenerated";
|
@@ -115,15 +116,10 @@ function WorkspaceResultsRow({ template }: { template: Template }) {
|
115 | 116 |
|
116 | 117 | type WorkspacesButtonProps = {
|
117 | 118 | children: string | ReactElement;
|
118 |
| - seeMoreTemplatesText: string | ReactElement; |
119 | 119 | };
|
120 | 120 |
|
121 |
| -export function WorkspacesButton({ |
122 |
| - children, |
123 |
| - seeMoreTemplatesText, |
124 |
| -}: WorkspacesButtonProps) { |
| 121 | +export function WorkspacesButton({ children }: WorkspacesButtonProps) { |
125 | 122 | const organizationId = useOrganizationId();
|
126 |
| - const permissions = usePermissions(); |
127 | 123 | const templatesQuery = useQuery(templates(organizationId));
|
128 | 124 | const theme = useTheme();
|
129 | 125 |
|
@@ -193,36 +189,34 @@ export function WorkspacesButton({
|
193 | 189 | )}
|
194 | 190 | </OverflowY>
|
195 | 191 |
|
196 |
| - {permissions.createTemplates && ( |
197 |
| - <Link |
198 |
| - component={RouterLink} |
199 |
| - to="/templates" |
| 192 | + <Link |
| 193 | + component={RouterLink} |
| 194 | + to="/templates" |
| 195 | + sx={{ |
| 196 | + outline: "none", |
| 197 | + "&:focus": { |
| 198 | + backgroundColor: theme.palette.action.focus, |
| 199 | + }, |
| 200 | + }} |
| 201 | + > |
| 202 | + <Box |
200 | 203 | sx={{
|
201 |
| - outline: "none", |
202 |
| - "&:focus": { |
203 |
| - backgroundColor: theme.palette.action.focus, |
204 |
| - }, |
| 204 | + padding: 2, |
| 205 | + display: "flex", |
| 206 | + flexFlow: "row nowrap", |
| 207 | + alignItems: "center", |
| 208 | + columnGap: COLUMN_GAP, |
| 209 | + borderTop: `1px solid ${theme.palette.divider}`, |
205 | 210 | }}
|
206 | 211 | >
|
207 |
| - <Box |
208 |
| - sx={{ |
209 |
| - padding: 2, |
210 |
| - display: "flex", |
211 |
| - flexFlow: "row nowrap", |
212 |
| - alignItems: "center", |
213 |
| - columnGap: COLUMN_GAP, |
214 |
| - borderTop: `1px solid ${theme.palette.divider}`, |
215 |
| - }} |
216 |
| - > |
217 |
| - <Box component="span" sx={{ width: `${ICON_SIZE}px` }}> |
218 |
| - <OpenIcon |
219 |
| - sx={{ fontSize: "16px", marginX: "auto", display: "block" }} |
220 |
| - /> |
221 |
| - </Box> |
222 |
| - <span>{seeMoreTemplatesText}</span> |
| 212 | + <Box component="span" sx={{ width: `${ICON_SIZE}px` }}> |
| 213 | + <OpenIcon |
| 214 | + sx={{ fontSize: "16px", marginX: "auto", display: "block" }} |
| 215 | + /> |
223 | 216 | </Box>
|
224 |
| - </Link> |
225 |
| - )} |
| 217 | + <span>{Language.seeAllTemplates}</span> |
| 218 | + </Box> |
| 219 | + </Link> |
226 | 220 | </PopoverContainer>
|
227 | 221 | );
|
228 | 222 | }
|
0 commit comments