mirror of
https://github.com/coder/coder.git
synced 2025-07-21 01:28:49 +00:00
fix: fix empty workspaces result (#17484)
After refactoring the workspaces table to use the new table components://github.com/coder/coder/pull/17404), the empty styles got broken. You can see the related PR [here](https://github.com/coder/coder/pull/17404). Before:  After: <img width="1210" alt="Screenshot 2025-04-21 at 10 34 19" src="https://github.com/user-attachments/assets/6545d078-80f1-4251-8816-04eb0f41e848" />
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
import type { Template } from "api/typesGenerated";
|
import type { Template } from "api/typesGenerated";
|
||||||
import { Avatar } from "components/Avatar/Avatar";
|
import { Avatar } from "components/Avatar/Avatar";
|
||||||
import { Button } from "components/Button/Button";
|
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 { linkToTemplate, useLinks } from "modules/navigation";
|
||||||
import type { FC } from "react";
|
import type { FC } from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
@ -31,12 +31,12 @@ export const WorkspacesEmpty: FC<WorkspacesEmptyProps> = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (isUsingFilter) {
|
if (isUsingFilter) {
|
||||||
return <TableEmpty message="No results matched your search" />;
|
return <EmptyState message="No results matched your search" />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (templates && templates.length === 0 && canCreateTemplate) {
|
if (templates && templates.length === 0 && canCreateTemplate) {
|
||||||
return (
|
return (
|
||||||
<TableEmpty
|
<EmptyState
|
||||||
message={defaultTitle}
|
message={defaultTitle}
|
||||||
description={`${defaultMessage} To create a workspace, you first need to create a template.`}
|
description={`${defaultMessage} To create a workspace, you first need to create a template.`}
|
||||||
cta={
|
cta={
|
||||||
@ -52,7 +52,7 @@ export const WorkspacesEmpty: FC<WorkspacesEmptyProps> = ({
|
|||||||
|
|
||||||
if (templates && templates.length === 0 && !canCreateTemplate) {
|
if (templates && templates.length === 0 && !canCreateTemplate) {
|
||||||
return (
|
return (
|
||||||
<TableEmpty
|
<EmptyState
|
||||||
message={defaultTitle}
|
message={defaultTitle}
|
||||||
description={`${defaultMessage} There are no templates available, but you will see them here once your admin adds them.`}
|
description={`${defaultMessage} There are no templates available, but you will see them here once your admin adds them.`}
|
||||||
className="pb-0"
|
className="pb-0"
|
||||||
@ -62,7 +62,7 @@ export const WorkspacesEmpty: FC<WorkspacesEmptyProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableEmpty
|
<EmptyState
|
||||||
message={defaultTitle}
|
message={defaultTitle}
|
||||||
description={`${defaultMessage} Select one template below to start.`}
|
description={`${defaultMessage} Select one template below to start.`}
|
||||||
cta={
|
cta={
|
||||||
|
Reference in New Issue
Block a user