Skip to content

Commit 49728da

Browse files
committed
make updateParams as react component
1 parent 6dc21ee commit 49728da

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

components/SponsoredFeedsTableWithData.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ interface SponsoredFeedsTableProps {
1717
networkName: string;
1818
}
1919

20+
interface UpdateParamsProps {
21+
feed: SponsoredFeed;
22+
isDefault: boolean;
23+
}
24+
2025
/**
2126
* Helper functions
2227
*/
@@ -40,8 +45,7 @@ const formatUpdateParams = (feed: SponsoredFeed): string => {
4045
return `${timeStr} heartbeat / ${feed.price_deviation}% price deviation`;
4146
};
4247

43-
// Render update parameters with proper styling
44-
const renderUpdateParams = (feed: SponsoredFeed, isDefault: boolean) => {
48+
const UpdateParams: React.FC<UpdateParamsProps> = ({ feed, isDefault }) => {
4549
const timeFormat = formatTimeUnit(feed.time_difference);
4650
const timeStr =
4751
timeFormat.value === 1 ? timeFormat.unit : `${timeFormat.unit}s`;
@@ -182,7 +186,7 @@ export const SponsoredFeedsTable = ({
182186
</div>
183187
</td>
184188
<td className="px-3 py-2 align-top">
185-
{renderUpdateParams(feed, isDefault)}
189+
<UpdateParams feed={feed} isDefault={isDefault} />
186190
</td>
187191
</tr>
188192
);

0 commit comments

Comments
 (0)