Mask String content and copy content using button

I have this table row:

 {apiKeyData.api_token && (
                <div className="flex items-center gap-24 leading-6">
                  <FuseSvgIcon>heroicons-outline:key</FuseSvgIcon>
                  {apiKeyData.api_token}
                </div>
            )}

How I can limit the displayed String by only showing first 3 and last 3 characters and also add a button to copy the entire content?