Skip to content

Commit

Permalink
add prop for className
Browse files Browse the repository at this point in the history
  • Loading branch information
jenny-s51 committed Oct 8, 2024
1 parent f6ac8d4 commit f033a9d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
import EmptyModelRegistryState from '~/app/pages/modelRegistry/screens/components/EmptyModelRegistryState';
import RegisteredModelTable from './RegisteredModelTable';
import RegisteredModelsTableToolbar from './RegisteredModelsTableToolbar';
import FormFieldset from '../components/FormFieldset';

Check warning on line 18 in clients/ui/frontend/src/app/pages/modelRegistry/screens/RegisteredModels/RegisteredModelListView.tsx

View workflow job for this annotation

GitHub Actions / test-and-build

import statements should have an absolute path

type RegisteredModelListViewProps = {
registeredModels: RegisteredModel[];
Expand Down Expand Up @@ -90,23 +91,22 @@ const RegisteredModelListView: React.FC<RegisteredModelListViewProps> = ({
/>
</ToolbarFilter>
<ToolbarItem variant="label-group">
<div className="toolbar-fieldset-wrapper">
<TextInput
value={search}
type="text"
onChange={(_, searchValue) => {
setSearch(searchValue);
}}
style={{ minWidth: '200px' }}
data-testid="registered-model-table-search"
aria-label="Search"
/>
<fieldset aria-hidden="true" className="form-fieldset">
<legend className="form-fieldset-legend">
<span>{`Find by ${searchType.toLowerCase()}`}</span>
</legend>
</fieldset>
</div>
<FormFieldset
className="toolbar-fieldset-wrapper"
component={
<TextInput
value={search}
type="text"
onChange={(_, searchValue) => {
setSearch(searchValue);
}}
style={{ minWidth: '200px' }}
data-testid="registered-model-table-search"
aria-label="Search"
/>
}
field={`Find by ${searchType.toLowerCase()}`}
/>
</ToolbarItem>
</ToolbarGroup>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import React, { ReactNode } from 'react';
interface FormFieldsetProps {
component: ReactNode;
field: string;
className?: string;
}

const FormFieldset: React.FC<FormFieldsetProps> = ({ component, field }) => {
const FormFieldset: React.FC<FormFieldsetProps> = ({ component, field, className }) => {

Check failure on line 9 in clients/ui/frontend/src/app/pages/modelRegistry/screens/components/FormFieldset.tsx

View workflow job for this annotation

GitHub Actions / test-and-build

Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`
return (
<div className="form-fieldset-wrapper">
<div className={className ?? 'form-fieldset-wrapper'}>
{component}
<fieldset aria-hidden="true" className="form-fieldset">
<legend className="form-fieldset-legend">
Expand Down

0 comments on commit f033a9d

Please sign in to comment.