Files
nice-app-web/src/entities/tax/ui/invoice-arrow.tsx
2025-09-18 09:45:10 +09:00

24 lines
720 B
TypeScript

import { useEffect, useState } from 'react';
import { IMAGE_ROOT } from '@/shared/constants/common';
import { AltMsgKeys } from '@/entities/common/model/types';
import { InvoiceArrowProps } from '../model/types';
export const InvoiceArrow = ({ show }: InvoiceArrowProps) => {
const [altMsg, setAltMsg] = useState<AltMsgKeys>(AltMsgKeys.Fold);
const [className, setClassName] = useState<string>('ic20 rot-180');
useEffect(() => {
setAltMsg((show)? AltMsgKeys.Fold: AltMsgKeys.UnFold);
setClassName(`ic20 ${(show)? 'rot-180': ''}`);
}, [show]);
return (
<>
<img
className={ className }
src={ IMAGE_ROOT + '/select_arrow.svg' }
alt={ altMsg }
/>
</>
);
};