Skip to content

fix: fix empty workspaces result #17484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions site/src/pages/WorkspacesPage/WorkspacesEmpty.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Template } from "api/typesGenerated";
import { Avatar } from "components/Avatar/Avatar";
import { Button } from "components/Button/Button";
import { TableEmpty } from "components/TableEmpty/TableEmpty";
import { EmptyState } from "components/EmptyState/EmptyState";
import { linkToTemplate, useLinks } from "modules/navigation";
import type { FC } from "react";
import { Link } from "react-router-dom";
Expand Down Expand Up @@ -31,12 +31,12 @@ export const WorkspacesEmpty: FC<WorkspacesEmptyProps> = ({
);

if (isUsingFilter) {
return <TableEmpty message="No results matched your search" />;
return <EmptyState message="No results matched your search" />;
}

if (templates && templates.length === 0 && canCreateTemplate) {
return (
<TableEmpty
<EmptyState
message={defaultTitle}
description={`${defaultMessage} To create a workspace, you first need to create a template.`}
cta={
Expand All @@ -52,7 +52,7 @@ export const WorkspacesEmpty: FC<WorkspacesEmptyProps> = ({

if (templates && templates.length === 0 && !canCreateTemplate) {
return (
<TableEmpty
<EmptyState
message={defaultTitle}
description={`${defaultMessage} There are no templates available, but you will see them here once your admin adds them.`}
className="pb-0"
Expand All @@ -62,7 +62,7 @@ export const WorkspacesEmpty: FC<WorkspacesEmptyProps> = ({
}

return (
<TableEmpty
<EmptyState
message={defaultTitle}
description={`${defaultMessage} Select one template below to start.`}
cta={
Expand Down
Loading