ant-design/components/_util/InputAddon.tsx
lijianan 41fba82b39
refactor: code optimization (#49431)
* refactor: refactor InputAddon code

* fix: fix

* fix: fix

* Update components/_util/InputAddon.tsx

Signed-off-by: afc163 <afc163@gmail.com>

* fix: fix lint

---------

Signed-off-by: afc163 <afc163@gmail.com>
Co-authored-by: afc163 <afc163@gmail.com>
2024-06-16 15:44:18 +08:00

16 lines
365 B
TypeScript

import React from 'react';
import { NoFormStyle } from '../form/context';
import { NoCompactStyle } from '../space/Compact';
const getInputAddon = (addon: React.ReactNode): React.ReactNode =>
addon ? (
<NoCompactStyle>
<NoFormStyle override status>
{addon}
</NoFormStyle>
</NoCompactStyle>
) : null;
export default getInputAddon;