diff --git a/app/forms/idp/edit.tsx b/app/forms/idp/edit.tsx index fa9e5a149..34dc2f322 100644 --- a/app/forms/idp/edit.tsx +++ b/app/forms/idp/edit.tsx @@ -16,11 +16,9 @@ import { NameField } from '~/components/form/fields/NameField' import { TextField } from '~/components/form/fields/TextField' import { SideModalForm } from '~/components/form/SideModalForm' import { getIdpSelector, useIdpSelector } from '~/hooks/use-params' -import { DateTime } from '~/ui/lib/DateTime' import { FormDivider } from '~/ui/lib/Divider' import { PropertiesTable } from '~/ui/lib/PropertiesTable' import { ResourceLabel, SideModal } from '~/ui/lib/SideModal' -import { Truncate } from '~/ui/lib/Truncate' import { pb } from '~/util/path-builder' EditIdpSideModalForm.loader = async ({ params }: LoaderFunctionArgs) => { @@ -61,15 +59,9 @@ export function EditIdpSideModalForm() { loading={false} > - - - - - - - - - + + + diff --git a/app/forms/image-edit.tsx b/app/forms/image-edit.tsx index 882bd9325..594cc2939 100644 --- a/app/forms/image-edit.tsx +++ b/app/forms/image-edit.tsx @@ -21,10 +21,8 @@ import { useProjectImageSelector, useSiloImageSelector, } from '~/hooks/use-params' -import { DateTime } from '~/ui/lib/DateTime' import { PropertiesTable } from '~/ui/lib/PropertiesTable' import { ResourceLabel } from '~/ui/lib/SideModal' -import { Truncate } from '~/ui/lib/Truncate' import { pb } from '~/util/path-builder' import { capitalize } from '~/util/str' import { bytesToGiB } from '~/util/units' @@ -96,19 +94,13 @@ function EditImageSideModalForm({ > {type} - - - + {bytesToGiB(image.size)} GiB - - - - - - + + diff --git a/app/forms/ssh-key-edit.tsx b/app/forms/ssh-key-edit.tsx index 609ec225c..161b7bd49 100644 --- a/app/forms/ssh-key-edit.tsx +++ b/app/forms/ssh-key-edit.tsx @@ -17,10 +17,8 @@ import { TextField } from '~/components/form/fields/TextField' import { SideModalForm } from '~/components/form/SideModalForm' import { getSshKeySelector, useSshKeySelector } from '~/hooks/use-params' import { CopyToClipboard } from '~/ui/lib/CopyToClipboard' -import { DateTime } from '~/ui/lib/DateTime' import { PropertiesTable } from '~/ui/lib/PropertiesTable' import { ResourceLabel } from '~/ui/lib/SideModal' -import { Truncate } from '~/ui/lib/Truncate' import { pb } from '~/util/path-builder' EditSSHKeySideModalForm.loader = async ({ params }: LoaderFunctionArgs) => { @@ -56,15 +54,9 @@ export function EditSSHKeySideModalForm() { submitError={null} > - - - - - - - - - + + + diff --git a/app/pages/project/instances/instance/InstancePage.tsx b/app/pages/project/instances/instance/InstancePage.tsx index 46d1397bd..92871b78c 100644 --- a/app/pages/project/instances/instance/InstancePage.tsx +++ b/app/pages/project/instances/instance/InstancePage.tsx @@ -42,7 +42,6 @@ import { import { addToast } from '~/stores/toast' import { EmptyCell } from '~/table/cells/EmptyCell' import { Button } from '~/ui/lib/Button' -import { DateTime } from '~/ui/lib/DateTime' import { Message } from '~/ui/lib/Message' import { Modal } from '~/ui/lib/Modal' import { PageHeader, PageTitle } from '~/ui/lib/PageHeader' @@ -234,14 +233,8 @@ export function InstancePage() { - - - - - - {instance.id} - - + + {} diff --git a/app/pages/project/vpcs/RouterPage.tsx b/app/pages/project/vpcs/RouterPage.tsx index 54304780e..a8e1a7760 100644 --- a/app/pages/project/vpcs/RouterPage.tsx +++ b/app/pages/project/vpcs/RouterPage.tsx @@ -36,7 +36,6 @@ import { useColsWithActions, type MenuAction } from '~/table/columns/action-col' import { useQueryTable } from '~/table/QueryTable' import { Badge } from '~/ui/lib/Badge' import { CreateButton, CreateLink } from '~/ui/lib/CreateButton' -import { DateTime } from '~/ui/lib/DateTime' import { EmptyMessage } from '~/ui/lib/EmptyMessage' import { PageHeader, PageTitle } from '~/ui/lib/PageHeader' import { PropertiesTable } from '~/ui/lib/PropertiesTable' @@ -210,12 +209,8 @@ export function Component() { - - - - - - + + diff --git a/app/pages/project/vpcs/VpcPage/VpcPage.tsx b/app/pages/project/vpcs/VpcPage/VpcPage.tsx index 87993db96..7e706540b 100644 --- a/app/pages/project/vpcs/VpcPage/VpcPage.tsx +++ b/app/pages/project/vpcs/VpcPage/VpcPage.tsx @@ -18,7 +18,6 @@ import { getVpcSelector, useVpcSelector } from '~/hooks/use-params' import { confirmDelete } from '~/stores/confirm-delete' import { addToast } from '~/stores/toast' import { DescriptionCell } from '~/table/cells/DescriptionCell' -import { DateTime } from '~/ui/lib/DateTime' import { PageHeader, PageTitle } from '~/ui/lib/PageHeader' import { PropertiesTable } from '~/ui/lib/PropertiesTable' import { pb } from '~/util/path-builder' @@ -85,12 +84,8 @@ export function VpcPage() { {vpc.dnsName} - - - - - - + + diff --git a/app/pages/system/silos/SiloPage.tsx b/app/pages/system/silos/SiloPage.tsx index 558df43dc..beaf7be2f 100644 --- a/app/pages/system/silos/SiloPage.tsx +++ b/app/pages/system/silos/SiloPage.tsx @@ -15,7 +15,6 @@ import { QueryParamTabs } from '~/components/QueryParamTabs' import { getSiloSelector, useSiloSelector } from '~/hooks/use-params' import { DescriptionCell } from '~/table/cells/DescriptionCell' import { Badge } from '~/ui/lib/Badge' -import { DateTime } from '~/ui/lib/DateTime' import { EmptyMessage } from '~/ui/lib/EmptyMessage' import { PageHeader, PageTitle } from '~/ui/lib/PageHeader' import { PropertiesTable } from '~/ui/lib/PropertiesTable' @@ -68,18 +67,14 @@ export function Component() { - {silo.id} + - - - - - - + + diff --git a/app/ui/lib/PropertiesTable.tsx b/app/ui/lib/PropertiesTable.tsx index 5b2c6a104..9aeea6b2c 100644 --- a/app/ui/lib/PropertiesTable.tsx +++ b/app/ui/lib/PropertiesTable.tsx @@ -12,6 +12,9 @@ import { Badge } from '~/ui/lib/Badge' import { isOneOf } from '~/util/children' import { invariant } from '~/util/invariant' +import { DateTime } from './DateTime' +import { Truncate } from './Truncate' + export interface PropertiesTableProps { className?: string children: ReactNode @@ -19,7 +22,11 @@ export interface PropertiesTableProps { export function PropertiesTable({ className, children }: PropertiesTableProps) { invariant( - isOneOf(children, [PropertiesTable.Row]), + isOneOf(children, [ + PropertiesTable.Row, + PropertiesTable.IdRow, + PropertiesTable.DateRow, + ]), 'PropertiesTable can only have PropertiesTable.Row as a child' ) return ( @@ -49,6 +56,24 @@ PropertiesTable.Row = ({ label, children }: PropertiesTableRowProps) => ( ) +PropertiesTable.IdRow = ({ id }: { id: string }) => ( + + + +) + +PropertiesTable.DateRow = ({ + date, + label, +}: { + date: Date + label: 'Created' | 'Updated' | 'Last Modified' +}) => ( + + + +) + interface PropertiesTableGroupProps { children: ReactNode className?: string